apple / pkl-intellij

JetBrains editor plugins providing Pkl language support
https://pkl-lang.org/intellij/current/index.html
Apache License 2.0
49 stars 10 forks source link

forbid separators between a type and its constraints #54

Closed stackoverflow closed 1 month ago

stackoverflow commented 1 month ago

This fixes a bug where a parenthesised expression in a new line after a type test was being parsed as the constraint of the type:

facts {
  ["test"] {
    (test) { base = test.kind }.kind is String
    (test) { base = "a" }.kind is String
  }
}

Was being parsed as

facts {
  ["test"] {
    (test) { base = test.kind }.kind is String(test)
    { base = "a" }.kind is String
  }
}

With this change a type constraint cannot start in a new line.