Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
528c1ee
wip
eureka-cpu Jun 18, 2022
18973e6
add test, update function
eureka-cpu Jun 18, 2022
c8ac435
Merge branch 'master' into eureka-cpu/add-abi
eureka-cpu Jun 20, 2022
b0d2fd6
Merge branch 'master' into eureka-cpu/add-abi
eureka-cpu Jun 20, 2022
d7a2ca4
adding items --
eureka-cpu Jun 21, 2022
62d49c2
update abi with new annotation formatting
eureka-cpu Jun 22, 2022
ba9690d
Merge branch 'master' into eureka-cpu/add-abi
eureka-cpu Jun 22, 2022
6faad01
Merge branch 'master' into eureka-cpu/add-abi
eureka-cpu Jun 22, 2022
fa0dcf8
Merge branch 'master' into eureka-cpu/add-abi
eureka-cpu Jun 22, 2022
8a6616d
small refactor, test now fails as intended
eureka-cpu Jun 22, 2022
cf5f3fa
small fix for indentations
eureka-cpu Jun 22, 2022
ebf521b
update extra_width with config values
eureka-cpu Jun 22, 2022
148f5b0
abi test passes
Jun 22, 2022
307f7c1
Merge branch 'master' into eureka-cpu/add-abi
eureka-cpu Jun 22, 2022
7350179
Merge branch 'master' of https://github.com/FuelLabs/sway into eureka…
Jun 22, 2022
52587b5
add shape for ItemFn
Jun 22, 2022
11004a5
Merge branch 'eureka-cpu/add-abi' of https://github.com/FuelLabs/sway…
Jun 22, 2022
1e92a7b
ensure unannotated functions have correct indentation
eureka-cpu Jun 22, 2022
7af2469
Merge branch 'master' into eureka-cpu/add-abi
eureka-cpu Jun 22, 2022
f250ef4
clippy
eureka-cpu Jun 22, 2022
1352cb2
Merge branch 'master' into eureka-cpu/add-abi
eureka-cpu Jun 22, 2022
99ad95b
Merge branch 'master' into eureka-cpu/add-abi
eureka-cpu Jun 22, 2022
dcf27a3
Merge branch 'master' into eureka-cpu/add-abi
eureka-cpu Jun 23, 2022
e9cb875
Merge branch 'master' into eureka-cpu/add-abi
eureka-cpu Jun 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions sway-fmt-v2/src/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ enum Color {
let correct_sway_code = r#"contract;

enum Color {
Blue : (),
Green : (),
Red : (),
Silver : (),
Grey : (),
Blue : (),
Green : (),
Red : (),
Silver : (),
Grey : (),
}"#;
let mut formatter = Formatter::default();
let formatted_sway_code =
Expand All @@ -129,11 +129,11 @@ enum Color {
let correct_sway_code = r#"contract;

enum Color {
Blue : (),
Green : (),
Red : (),
Silver : (),
Grey : (),
Blue : (),
Green : (),
Red : (),
Silver : (),
Grey : (),
}"#;

// Creating a config with enum_variant_align_threshold that exceeds longest variant length
Expand Down
6 changes: 3 additions & 3 deletions sway-fmt-v2/src/items/item_abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ impl CurlyBrace for ItemAbi {
ItemBraceStyle::AlwaysNextLine => {
// Add openning brace to the next line.
line.push_str(&format!("\n{}\n", open_brace));
shape = shape.block_indent(1);
shape = shape.block_indent(4);
}
_ => {
// Add opening brace to the same line
line.push_str(&format!(" {}\n", open_brace));
shape = shape.block_indent(1);
shape = shape.block_indent(4);
}
}

Expand All @@ -88,6 +88,6 @@ impl CurlyBrace for ItemAbi {
fn close_curly_brace(line: &mut String, formatter: &mut Formatter) {
line.push(Delimiter::Brace.as_close_char());
// If shape is becoming left-most alligned or - indent just have the defualt shape
formatter.shape = formatter.shape.shrink_left(1).unwrap_or_default();
formatter.shape = formatter.shape.shrink_left(4).unwrap_or_default();
}
}
6 changes: 3 additions & 3 deletions sway-fmt-v2/src/items/item_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ impl CurlyBrace for ItemEnum {
ItemBraceStyle::AlwaysNextLine => {
// Add openning brace to the next line.
line.push_str("\n{\n");
shape = shape.block_indent(1);
shape = shape.block_indent(4);
}
_ => {
// Add opening brace to the same line
line.push_str(" {\n");
shape = shape.block_indent(1);
shape = shape.block_indent(4);
}
}

Expand All @@ -99,6 +99,6 @@ impl CurlyBrace for ItemEnum {
fn close_curly_brace(line: &mut String, formatter: &mut Formatter) {
line.push('}');
// If shape is becoming left-most alligned or - indent just have the defualt shape
formatter.shape = formatter.shape.shrink_left(1).unwrap_or_default();
formatter.shape = formatter.shape.shrink_left(4).unwrap_or_default();
}
}