diff --git a/ast/src/lang/core/def/def_to_def2.rs b/ast/src/lang/core/def/def_to_def2.rs index c1a8d6c72b..96e974550a 100644 --- a/ast/src/lang/core/def/def_to_def2.rs +++ b/ast/src/lang/core/def/def_to_def2.rs @@ -33,6 +33,7 @@ pub fn def_to_def2<'a>( match parsed_def { SpaceBefore(inner_def, comments) => { + // filter comments if !comments.is_empty() && !all_newlines(comments) { let inner_def = def_to_def2(arena, env, scope, inner_def, region); @@ -52,6 +53,7 @@ pub fn def_to_def2<'a>( } } SpaceAfter(inner_def, comments) => { + // filter comments if !comments.is_empty() && !all_newlines(comments) { let inner_def = def_to_def2(arena, env, scope, inner_def, region); diff --git a/ast/src/lang/core/expr/expr_to_expr2.rs b/ast/src/lang/core/expr/expr_to_expr2.rs index 531fec4daf..917571d87f 100644 --- a/ast/src/lang/core/expr/expr_to_expr2.rs +++ b/ast/src/lang/core/expr/expr_to_expr2.rs @@ -671,7 +671,6 @@ pub fn expr_to_expr2<'a>( ); } bad_expr @ SpaceBefore(_, _) => { - // TODO no panic, move in Expr2::Comment panic!( "A SpaceBefore did not get removed during operator desugaring somehow: {:#?}", bad_expr diff --git a/cli_utils/Cargo.lock b/cli_utils/Cargo.lock index 49dbb3fa2c..5fa0d0ee9b 100644 --- a/cli_utils/Cargo.lock +++ b/cli_utils/Cargo.lock @@ -2679,6 +2679,7 @@ dependencies = [ "roc_collections", "roc_module", "roc_mono", + "roc_reporting", "roc_std", ] diff --git a/editor/src/editor/mvc/ed_update.rs b/editor/src/editor/mvc/ed_update.rs index d281de7ded..f69527914d 100644 --- a/editor/src/editor/mvc/ed_update.rs +++ b/editor/src/editor/mvc/ed_update.rs @@ -1472,7 +1472,7 @@ pub mod test_ed_update { // add newlines like the editor's formatting would add them fn add_nls(lines: Vec) -> Vec { let mut new_lines = lines; - + //Two lines between TLD's, extra newline so the user can go to third line add new def there new_lines.append(&mut vec!["".to_owned(), "".to_owned(), "".to_owned()]); new_lines