diff --git a/build.gradle.kts b/build.gradle.kts index 9fc733c4c..ee4fe9626 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -40,7 +40,7 @@ fun gitTimestamp(): String { } val shortPlatformVersion = prop("shortPlatformVersion") -val codeVersion = "1.36.0" +val codeVersion = "1.36.1" var pluginVersion = "$codeVersion.$shortPlatformVersion" if (publishingChannel != "default") { diff --git a/src/main/kotlin/org/move/ide/formatter/impl/utils.kt b/src/main/kotlin/org/move/ide/formatter/impl/utils.kt index 34a936afc..a35507fdb 100644 --- a/src/main/kotlin/org/move/ide/formatter/impl/utils.kt +++ b/src/main/kotlin/org/move/ide/formatter/impl/utils.kt @@ -21,9 +21,10 @@ val ONE_LINE_ITEMS = ts(USE_STMT, CONST) val PAREN_DELIMITED_BLOCKS = ts( PARENS_EXPR, TUPLE_PAT, TUPLE_TYPE, TUPLE_LIT_EXPR, CONDITION, - FUNCTION_PARAMETER_LIST, VALUE_ARGUMENT_LIST, ATTR_ITEM_LIST + FUNCTION_PARAMETER_LIST, VALUE_ARGUMENT_LIST, ATTR_ITEM_LIST, + ITEM_SPEC_FUNCTION_PARAMETER_LIST ) -val ANGLE_DELIMITED_BLOCKS = ts(TYPE_PARAMETER_LIST, TYPE_ARGUMENT_LIST) +val ANGLE_DELIMITED_BLOCKS = ts(TYPE_PARAMETER_LIST, TYPE_ARGUMENT_LIST, ITEM_SPEC_TYPE_PARAMETER_LIST) val BRACKET_DELIMITED_BLOCKS = ts(VECTOR_LIT_ITEMS) val STRUCT_LITERAL_BLOCKS = ts(STRUCT_PAT_FIELDS_BLOCK, STRUCT_LIT_FIELDS_BLOCK) diff --git a/src/test/kotlin/org/move/ide/formatter/FormatterTest.kt b/src/test/kotlin/org/move/ide/formatter/FormatterTest.kt index 3d641f361..09ee8a418 100644 --- a/src/test/kotlin/org/move/ide/formatter/FormatterTest.kt +++ b/src/test/kotlin/org/move/ide/formatter/FormatterTest.kt @@ -8,6 +8,7 @@ class FormatterTest : MvFormatterTestBase() { fun `test address block`() = doTest() fun `test operators`() = doTest() fun `test functions`() = doTest() + fun `test function parameters`() = doTest() fun `test specs`() = doTest() fun `test structs`() = doTest() fun `test inner block`() = doTest() diff --git a/src/test/resources/org/move/ide/formatter.fixtures/function_parameters.move b/src/test/resources/org/move/ide/formatter.fixtures/function_parameters.move new file mode 100644 index 000000000..4e3b911d0 --- /dev/null +++ b/src/test/resources/org/move/ide/formatter.fixtures/function_parameters.move @@ -0,0 +1,27 @@ +module 0x1::function_parameters { + fun prologue( + a: u8, + b: u8, + c: u8, + ): u8 {} + + spec prologue( + a: u8, + b: u8, + c: u8, + ): u8 {} + + spec fun prologue( + a: u8, + b: u8, + c: u8, + ): u8 {} + + spec module { + fun prologue( + a: u8, + b: u8, + c: u8, + ): u8 {} + } +} diff --git a/src/test/resources/org/move/ide/formatter.fixtures/function_parameters_after.move b/src/test/resources/org/move/ide/formatter.fixtures/function_parameters_after.move new file mode 100644 index 000000000..f2015123e --- /dev/null +++ b/src/test/resources/org/move/ide/formatter.fixtures/function_parameters_after.move @@ -0,0 +1,27 @@ +module 0x1::function_parameters { + fun prologue( + a: u8, + b: u8, + c: u8, + ): u8 {} + + spec prologue( + a: u8, + b: u8, + c: u8, + ): u8 {} + + spec fun prologue( + a: u8, + b: u8, + c: u8, + ): u8 {} + + spec module { + fun prologue( + a: u8, + b: u8, + c: u8, + ): u8 {} + } +}