Skip to content

Commit

Permalink
Merge pull request #163 from pontem-network/formatting-fixes
Browse files Browse the repository at this point in the history
fix formatting for item spec parameter lists
  • Loading branch information
mkurnikov authored Jun 27, 2024
2 parents d75fe23 + 0c5c3f4 commit f03af08
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
5 changes: 3 additions & 2 deletions src/main/kotlin/org/move/ide/formatter/impl/utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/test/kotlin/org/move/ide/formatter/FormatterTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {}
}
}
Original file line number Diff line number Diff line change
@@ -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 {}
}
}

0 comments on commit f03af08

Please sign in to comment.