Skip to content

Commit

Permalink
Fixes after rebasing
Browse files Browse the repository at this point in the history
  • Loading branch information
tgodzik committed Jul 18, 2022
1 parent ea9012e commit 30cc0f4
Showing 1 changed file with 15 additions and 131 deletions.
146 changes: 15 additions & 131 deletions tests/slow/src/test/scala/tests/feature/Scala3CodeActionLspSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,21 @@ class Scala3CodeActionLspSuite
expectNoDiagnostics = false,
)

check(
"named-basic",
"""|object Something {
| case class Foo(param1: Int, param2: Int, param3: Int)
| Foo<<(>>1, 2, param3 = 3)
| Foo(4,5,6)
|}""".stripMargin,
s"${ConvertToNamedArguments.title("Foo(...)")}",
"""|object Something {
| case class Foo(param1: Int, param2: Int, param3: Int)
| Foo(param1 = 1, param2 = 2, param3 = 3)
| Foo(4,5,6)
|}""".stripMargin,
)

check(
"given-object-creation",
"""|package a
Expand Down Expand Up @@ -390,137 +405,6 @@ class Scala3CodeActionLspSuite
expectNoDiagnostics = false,
)

check(
"named-basic",
"""|object Something {
| case class Foo(param1: Int, param2: Int, param3: Int)
| Foo<<(>>1, 2, param3 = 3)
| Foo(4,5,6)
|}""".stripMargin,
s"${ConvertToNamedArguments.title("Foo")}",
"""|object Something {
| case class Foo(param1: Int, param2: Int, param3: Int)
| Foo(param1 = 1, param2 = 2, param3 = 3)
| Foo(4,5,6)
|}""".stripMargin,
)

check(
"named-arg-first-position",
"""|object Something {
| case class Foo(param1: Int, param2: Int, param3: Int)
| Foo<<(>>param1 = 1, 2, 3)
|}""".stripMargin,
s"${ConvertToNamedArguments.title("Foo")}",
"""|object Something {
| case class Foo(param1: Int, param2: Int, param3: Int)
| Foo(param1 = 1, param2 = 2, param3 = 3)
|}""".stripMargin,
)

check(
"named-def",
"""|object Something {
| def foo(param1: Int, param2: Int, param3: Int) = None
| foo<<(>>1, 2, param3 = 3)
|}""".stripMargin,
s"${ConvertToNamedArguments.title("foo")}",
"""|object Something {
| def foo(param1: Int, param2: Int, param3: Int) = None
| foo(param1 = 1, param2 = 2, param3 = 3)
|}""".stripMargin,
)

check(
"named-multiple-arg-lists",
"""|object Something {
| def foo(param1: Int, param2: Int, param3: Int)(param4: Int) = None
| foo<<(>>1, 2, param3 = 3)(4)
|}""".stripMargin,
s"${ConvertToNamedArguments.title("foo")}",
"""|object Something {
| def foo(param1: Int, param2: Int, param3: Int)(param4: Int) = None
| foo(param1 = 1, param2 = 2, param3 = 3)(4)
|}""".stripMargin,
)

check(
"named-multiple-arg-lists-start-of-2nd",
"""|object Something {
| def foo(param1: Int, param2: Int, param3: Int)(param4: Int) = None
| foo(1, 2, param3 = 3)<<(>>4)
|}""".stripMargin,
s"${ConvertToNamedArguments.title("foo")}",
"""|object Something {
| def foo(param1: Int, param2: Int, param3: Int)(param4: Int) = None
| foo(param1 = 1, param2 = 2, param3 = 3)(4)
|}""".stripMargin,
)

check(
"named-multiple-arg-lists-only-2nd",
"""|object Something {
| def foo(param1: Int, param2: Int, param3: Int)(param4: Int) = None
| foo(1, 2, param3 = 3)(<<4>>)
| foo(5,6,7)(8)
|}""".stripMargin,
s"${ConvertToNamedArguments.title("foo(1, 2, param3 = 3)")}",
"""|object Something {
| def foo(param1: Int, param2: Int, param3: Int)(param4: Int) = None
| foo(1, 2, param3 = 3)(param4 = 4)
| foo(5,6,7)(8)
|}""".stripMargin,
filterAction = filterAction,
)

check(
"named-implicit-passed-explicitly",
"""|object Something {
| def foo(param1: Int, param2: Int)(implicit param3: Int) = None
| foo(1, 2)(<<3>>)
|}""".stripMargin,
s"${ConvertToNamedArguments.title("foo(1, 2)")}",
"""|object Something {
| def foo(param1: Int, param2: Int)(implicit param3: Int) = None
| foo(1, 2)(param3 = 3)
|}""".stripMargin,
filterAction = filterAction,
)

check(
"named-arg-in-middle",
"""|object Something {
| case class Foo(param1: Int, param2: Int, param3: Int)
| Foo<<(>>1, param2 = 2, 3)
|}""".stripMargin,
s"${ConvertToNamedArguments.title("Foo")}",
"""|object Something {
| case class Foo(param1: Int, param2: Int, param3: Int)
| Foo(param1 = 1, param2 = 2, param3 = 3)
|}""".stripMargin,
)

checkNoAction(
"named-dont-convert-block",
"""|object Something {
| def f(x: Seq[Int]) = x.map <<{>> _.toLong }
|}""".stripMargin,
)

check(
"named-go-to-parent-apply",
"""|object Something {
| case class Foo(param1: Int, param2: Int, param3: String)
| Foo(1, 2, 3.t<<>>oString())
|}""".stripMargin,
s"${ConvertToNamedArguments.title("Foo")}",
"""|object Something {
| case class Foo(param1: Int, param2: Int, param3: String)
| Foo(param1 = 1, param2 = 2, param3 = 3.toString())
|}""".stripMargin,
filterAction = filterAction,
)

def checkExtractedMember(
name: TestOptions,
input: String,
Expand Down

0 comments on commit 30cc0f4

Please sign in to comment.