Unnamed repository; edit this file 'description' to name the repository.
Add tag queries for java, kotlin, protobuf and bash (#14349)
Kalpaj Chaudhari 6 months ago
parent 7c37e8a · commit d546a79
-rw-r--r--book/src/generated/lang-support.md8
-rw-r--r--runtime/queries/bash/tags.scm1
-rw-r--r--runtime/queries/java/tags.scm27
-rw-r--r--runtime/queries/kotlin/tags.scm12
-rw-r--r--runtime/queries/protobuf/tags.scm11
5 files changed, 55 insertions, 4 deletions
diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md
index d8284307..f6b58c8e 100644
--- a/book/src/generated/lang-support.md
+++ b/book/src/generated/lang-support.md
@@ -7,7 +7,7 @@
| amber | ✓ | | | | | `amber-lsp` |
| astro | ✓ | | | | | `astro-ls` |
| awk | ✓ | ✓ | | | | `awk-language-server` |
-| bash | ✓ | ✓ | ✓ | | ✓ | `bash-language-server` |
+| bash | ✓ | ✓ | ✓ | ✓ | ✓ | `bash-language-server` |
| bass | ✓ | | | | | `bass` |
| beancount | ✓ | | | | | `beancount-language-server` |
| bibtex | ✓ | | | | | `texlab` |
@@ -121,7 +121,7 @@
| ink | ✓ | | | | | |
| inko | ✓ | ✓ | ✓ | ✓ | | |
| janet | ✓ | | ✓ | | ✓ | |
-| java | ✓ | ✓ | ✓ | | ✓ | `jdtls` |
+| java | ✓ | ✓ | ✓ | ✓ | ✓ | `jdtls` |
| javascript | ✓ | ✓ | ✓ | ✓ | ✓ | `typescript-language-server` |
| jinja | ✓ | | | | | |
| jjconfig | ✓ | ✓ | ✓ | | | `taplo`, `tombi` |
@@ -141,7 +141,7 @@
| kconfig | ✓ | | ✓ | | | |
| kdl | ✓ | ✓ | ✓ | | | |
| koka | ✓ | | ✓ | | | `koka` |
-| kotlin | ✓ | ✓ | ✓ | | | `kotlin-language-server` |
+| kotlin | ✓ | ✓ | ✓ | ✓ | | `kotlin-language-server` |
| koto | ✓ | ✓ | ✓ | | | `koto-ls` |
| latex | ✓ | ✓ | | | | `texlab` |
| ld | ✓ | | ✓ | | | |
@@ -201,7 +201,7 @@
| prisma | ✓ | ✓ | | | | `prisma-language-server` |
| prolog | ✓ | | ✓ | | | `swipl` |
| properties | ✓ | ✓ | | | | |
-| protobuf | ✓ | ✓ | ✓ | | | `buf`, `pb`, `protols` |
+| protobuf | ✓ | ✓ | ✓ | ✓ | | `buf`, `pb`, `protols` |
| prql | ✓ | | | | | |
| pug | ✓ | | | | | |
| purescript | ✓ | ✓ | | | | `purescript-language-server` |
diff --git a/runtime/queries/bash/tags.scm b/runtime/queries/bash/tags.scm
new file mode 100644
index 00000000..f5d731e8
--- /dev/null
+++ b/runtime/queries/bash/tags.scm
@@ -0,0 +1 @@
+(function_definition name: (word) @definition.function)
diff --git a/runtime/queries/java/tags.scm b/runtime/queries/java/tags.scm
new file mode 100644
index 00000000..a8465022
--- /dev/null
+++ b/runtime/queries/java/tags.scm
@@ -0,0 +1,27 @@
+(class_declaration
+ name: (identifier) @definition.class)
+
+(interface_declaration
+ name: (identifier) @definition.interface)
+
+(record_declaration
+ name: (identifier) @definition.class)
+
+(enum_declaration
+ name: (identifier) @defintion.class)
+
+(method_declaration
+ name: (identifier) @definition.function)
+
+(constructor_declaration
+ name: (identifier) @definition.function)
+
+(compact_constructor_declaration
+ name: (identifier) @definition.function)
+
+(field_declaration
+ declarator: (variable_declarator
+ name: (identifier) @definition.constant))
+
+(enum_constant
+ name: (identifier) @definition.constant)
diff --git a/runtime/queries/kotlin/tags.scm b/runtime/queries/kotlin/tags.scm
new file mode 100644
index 00000000..b6bb3039
--- /dev/null
+++ b/runtime/queries/kotlin/tags.scm
@@ -0,0 +1,12 @@
+(class_declaration
+ (type_identifier) @definition.class)
+
+(object_declaration
+ "object" (type_identifier) @definition.class)
+
+(function_declaration
+ (simple_identifier) @definition.function)
+
+(property_declaration
+ (variable_declaration
+ (simple_identifier) @definition.constant))
diff --git a/runtime/queries/protobuf/tags.scm b/runtime/queries/protobuf/tags.scm
new file mode 100644
index 00000000..9f4d698e
--- /dev/null
+++ b/runtime/queries/protobuf/tags.scm
@@ -0,0 +1,11 @@
+(message_name (identifier) @definition.class)
+
+(enum_name (identifier) @definition.class)
+
+(service_name (identifier) @definition.class)
+
+(rpc_name (identifier) @definition.function)
+
+(enum_variant_name (identifier) @definition.constant)
+
+(field_name (identifier) @definition.constant)