Fork of daniellemaywood.uk/gleam — Wasm codegen work
2

Configure Feed

Select the types of activity you want to include in your feed.

add test for removing comments in echo as

+96
+41
compiler-core/src/language_server/tests/action.rs
··· 499 499 } 500 500 501 501 #[test] 502 + fn remove_echo_with_message_and_comment() { 503 + assert_code_action!( 504 + REMOVE_ALL_ECHOS_FROM_THIS_MODULE, 505 + r#"pub fn main() { 506 + echo 1 + 2 507 + // Hello! 508 + as "message" 509 + }"#, 510 + find_position_of("echo").to_selection() 511 + ); 512 + } 513 + 514 + #[test] 515 + fn remove_echo_with_message_and_comment_2() { 516 + assert_code_action!( 517 + REMOVE_ALL_ECHOS_FROM_THIS_MODULE, 518 + r#"pub fn main() { 519 + echo 1 + 2 as 520 + // Hello! 521 + "message" 522 + }"#, 523 + find_position_of("echo").to_selection() 524 + ); 525 + } 526 + 527 + #[test] 528 + fn remove_echo_with_message_and_comment_3() { 529 + assert_code_action!( 530 + REMOVE_ALL_ECHOS_FROM_THIS_MODULE, 531 + r#"pub fn main() { 532 + echo 1 + 2 as 533 + // Hello! 534 + "message" 535 + 536 + Nil 537 + }"#, 538 + find_position_of("echo").to_selection() 539 + ); 540 + } 541 + 542 + #[test] 502 543 fn remove_echo_selecting_expression() { 503 544 assert_code_action!( 504 545 REMOVE_ALL_ECHOS_FROM_THIS_MODULE,
+17
compiler-core/src/language_server/tests/snapshots/gleam_core__language_server__tests__action__remove_echo_with_message_and_comment.snap
··· 1 + --- 2 + source: compiler-core/src/language_server/tests/action.rs 3 + expression: "pub fn main() {\n echo 1 + 2\n // Hello!\n as \"message\"\n}" 4 + --- 5 + ----- BEFORE ACTION 6 + pub fn main() { 7 + echo 1 + 2 8 + 9 + // Hello! 10 + as "message" 11 + } 12 + 13 + 14 + ----- AFTER ACTION 15 + pub fn main() { 16 + 1 + 2 17 + }
+17
compiler-core/src/language_server/tests/snapshots/gleam_core__language_server__tests__action__remove_echo_with_message_and_comment_2.snap
··· 1 + --- 2 + source: compiler-core/src/language_server/tests/action.rs 3 + expression: "pub fn main() {\n echo 1 + 2 as\n // Hello!\n \"message\"\n}" 4 + --- 5 + ----- BEFORE ACTION 6 + pub fn main() { 7 + echo 1 + 2 as 8 + 9 + // Hello! 10 + "message" 11 + } 12 + 13 + 14 + ----- AFTER ACTION 15 + pub fn main() { 16 + 1 + 2 17 + }
+21
compiler-core/src/language_server/tests/snapshots/gleam_core__language_server__tests__action__remove_echo_with_message_and_comment_3.snap
··· 1 + --- 2 + source: compiler-core/src/language_server/tests/action.rs 3 + expression: "pub fn main() {\n echo 1 + 2 as\n // Hello!\n \"message\"\n\n Nil\n}" 4 + --- 5 + ----- BEFORE ACTION 6 + pub fn main() { 7 + echo 1 + 2 as 8 + 9 + // Hello! 10 + "message" 11 + 12 + Nil 13 + } 14 + 15 + 16 + ----- AFTER ACTION 17 + pub fn main() { 18 + 1 + 2 19 + 20 + Nil 21 + }