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

Configure Feed

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

Make sure record update arguments are grouped together by the formatter

+18 -1
+2
CHANGELOG.md
··· 5 5 ### Formatter 6 6 7 7 - Fixed a bug where the `@internal` annotation wouldn't be displayed. 8 + - Fixed a bug where a record update's arguments would be incorrectly split on 9 + multiple lines. 8 10 9 11 ## v1.1.0-rc2 - 2024-04-10 10 12
+1 -1
compiler-core/src/format.rs
··· 1149 1149 let constructor_doc = self.expr(constructor); 1150 1150 let comments = self.pop_comments(spread.base.location().start); 1151 1151 let spread_doc = commented("..".to_doc().append(self.expr(&spread.base)), comments); 1152 - let arg_docs = args.iter().map(|a| self.record_update_arg(a)); 1152 + let arg_docs = args.iter().map(|a| self.record_update_arg(a).group()); 1153 1153 let all_arg_docs = once(spread_doc).chain(arg_docs); 1154 1154 constructor_doc.append(wrap_args(all_arg_docs)).group() 1155 1155 }
+15
compiler-core/src/format/tests.rs
··· 5840 5840 ); 5841 5841 } 5842 5842 5843 + // https://github.com/gleam-lang/gleam/issues/2924 5844 + #[test] 5845 + fn record_update_fields_are_not_needlessly_broken() { 5846 + assert_format!( 5847 + r#"pub fn main() { 5848 + Model( 5849 + ..model, 5850 + wibble: wibble_wobble_wibble_wobble + 1, 5851 + wobble: Some(wibble_wobble_wibble_wobble), 5852 + ) 5853 + } 5854 + "# 5855 + ); 5856 + } 5857 + 5843 5858 // https://github.com/gleam-lang/gleam/issues/2890 5844 5859 #[test] 5845 5860 fn piped_lists_are_not_needlessly_indented() {