feat(treesitter): groovy support (#351)

This commit is contained in:
emmanueltouzery 2024-03-12 00:29:45 +01:00 committed by GitHub
parent 31fbd369bb
commit c8a40b1266
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 179 additions and 0 deletions

View file

@ -144,6 +144,7 @@ In addition, you will need to have either Treesitter or a working LSP client. Yo
- dart
- elixir
- go
- groovy
- help
- html
- java

22
queries/groovy/aerial.scm Normal file
View file

@ -0,0 +1,22 @@
(juxt_function_call
function: (identifier) @name (#not-any-of? @name "else" "try" "exec")
(argument_list (closure))
(#set! "kind" "Module")
) @symbol
(declaration
name: (identifier) @name
(closure)
(#set! "kind" "Function")
) @symbol
(juxt_function_call
function: (identifier) @keyword (#eq? @keyword "task")
(argument_list ((function_call function: (identifier) @name)))
(#set! "kind" "Function")
) @symbol
(declaration
name: (identifier) @name
(#set! "kind" "Constant")
) @symbol

View file

@ -0,0 +1,124 @@
[
{
"col": 0,
"end_col": 41,
"end_lnum": 4,
"kind": "Constant",
"level": 0,
"lnum": 4,
"name": "enableProguardInReleaseBuilds",
"selection_range": {
"col": 4,
"end_col": 33,
"end_lnum": 4,
"lnum": 4
}
},
{
"col": 0,
"end_col": 1,
"end_lnum": 8,
"kind": "Module",
"level": 0,
"lnum": 6,
"name": "plugins",
"selection_range": {
"col": 0,
"end_col": 7,
"end_lnum": 6,
"lnum": 6
}
},
{
"col": 0,
"end_col": 27,
"end_lnum": 10,
"kind": "Constant",
"level": 0,
"lnum": 10,
"name": "magicNumber",
"selection_range": {
"col": 4,
"end_col": 15,
"end_lnum": 10,
"lnum": 10
}
},
{
"children": [
{
"col": 4,
"end_col": 5,
"end_lnum": 19,
"kind": "Module",
"level": 1,
"lnum": 16,
"name": "compileOptions",
"selection_range": {
"col": 4,
"end_col": 18,
"end_lnum": 16,
"lnum": 16
}
}
],
"col": 0,
"end_col": 1,
"end_lnum": 20,
"kind": "Module",
"level": 0,
"lnum": 12,
"name": "android",
"selection_range": {
"col": 0,
"end_col": 7,
"end_lnum": 12,
"lnum": 12
}
},
{
"col": 0,
"end_col": 1,
"end_lnum": 26,
"kind": "Module",
"level": 0,
"lnum": 22,
"name": "dependencies",
"selection_range": {
"col": 0,
"end_col": 12,
"end_lnum": 22,
"lnum": 22
}
},
{
"col": 0,
"end_col": 12,
"end_lnum": 28,
"kind": "Constant",
"level": 0,
"lnum": 28,
"name": "welcome",
"selection_range": {
"col": 5,
"end_col": 12,
"end_lnum": 28,
"lnum": 28
}
},
{
"col": 4,
"end_col": 5,
"end_lnum": 31,
"kind": "Module",
"level": 0,
"lnum": 29,
"name": "doLast",
"selection_range": {
"col": 4,
"end_col": 10,
"end_lnum": 29,
"lnum": 29
}
}
]

View file

@ -0,0 +1,32 @@
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
plugins {
id 'com.android.application'
}
def magicNumber = { -> 42 }
android {
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation project(":lib")
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation fileTree(dir: 'libs', include: ['*.jar'])
}
task welcome {
doLast {
println 'Welcome'
}
}