tree-sitter-kotlin icon indicating copy to clipboard operation
tree-sitter-kotlin copied to clipboard

Support backtick'ed function names

Open lervag opened this issue 2 years ago • 0 comments

Kotlin has special syntax defined for Java interoperability where e.g. function names can be defined to be more or less anything delimited by backticks, e.g. (source: https://stackoverflow.com/a/65923081/51634):

fun `adding 3 and 4 should be equal to 7`() {
    assertEquals(calculator.add(3, 4), 7)
}

The documentation for this feature seems to be here:

  • https://kotlinlang.org/docs/java-interop.html#escaping-for-java-identifiers-that-are-keywords-in-kotlin
  • https://kotlinlang.org/docs/coding-conventions.html#names-for-test-methods

Notice that this feature is common for test functions. As such, I hope it could be possible to add support for it in the tree-sitter grammar.

lervag avatar Apr 20 '22 10:04 lervag