mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
Add tags.scm for Kotlin
This commit is contained in:
parent
6451d59deb
commit
293c350fb7
3 changed files with 44 additions and 0 deletions
27
aider/queries/tree-sitter-kotlin-tags.scm
Normal file
27
aider/queries/tree-sitter-kotlin-tags.scm
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
; Definitions
|
||||||
|
|
||||||
|
(class_declaration
|
||||||
|
(type_identifier) @name.definition.class) @definition.class
|
||||||
|
|
||||||
|
(function_declaration
|
||||||
|
(simple_identifier) @name.definition.function) @definition.function
|
||||||
|
|
||||||
|
(object_declaration
|
||||||
|
(type_identifier) @name.definition.object) @definition.object
|
||||||
|
|
||||||
|
; References
|
||||||
|
|
||||||
|
(call_expression
|
||||||
|
[
|
||||||
|
(simple_identifier) @name.reference.call
|
||||||
|
(navigation_expression
|
||||||
|
(navigation_suffix
|
||||||
|
(simple_identifier) @name.reference.call))
|
||||||
|
]) @reference.call
|
||||||
|
|
||||||
|
(delegation_specifier
|
||||||
|
[
|
||||||
|
(user_type) @name.reference.type
|
||||||
|
(constructor_invocation
|
||||||
|
(user_type) @name.reference.type)
|
||||||
|
]) @reference.type
|
|
@ -290,6 +290,7 @@ class TestRepoMapAllLanguages(unittest.TestCase):
|
||||||
"elixir": ("ex", "Greeter"),
|
"elixir": ("ex", "Greeter"),
|
||||||
"java": ("java", "Greeting"),
|
"java": ("java", "Greeting"),
|
||||||
"javascript": ("js", "Person"),
|
"javascript": ("js", "Person"),
|
||||||
|
"kotlin": ("kt", "Greeting"),
|
||||||
"ocaml": ("ml", "Greeter"),
|
"ocaml": ("ml", "Greeter"),
|
||||||
"php": ("php", "greet"),
|
"php": ("php", "greet"),
|
||||||
"python": ("py", "Person"),
|
"python": ("py", "Person"),
|
||||||
|
|
16
tests/fixtures/languages/kotlin/test.kt
vendored
Normal file
16
tests/fixtures/languages/kotlin/test.kt
vendored
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
interface Greeting {
|
||||||
|
fun greet(name: String): String
|
||||||
|
}
|
||||||
|
|
||||||
|
class Test : Greeting {
|
||||||
|
private val prefix = "Hello"
|
||||||
|
|
||||||
|
override fun greet(name: String): String {
|
||||||
|
return "$prefix, $name!"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
val greeter = Test()
|
||||||
|
println(greeter.greet("World"))
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue