Skip to content

Commit 68ac394

Browse files
authored
Import the JS GraphQL IntelliJ plugin (#43)
* Import the JS GraphQL IntelliJ plugin * Re-generate parser/lexer * Warn if the GraphQL plugin is installed * Rename .java to .kt * Convert icons to Kotlin * Remove references to internal classes
1 parent b8310d2 commit 68ac394

File tree

848 files changed

+76731
-60
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

848 files changed

+76731
-60
lines changed

gradle/libs.versions.toml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
11
[versions]
22
kotlin-plugin = "2.1.21"
3-
intellij-platform = "2.6.0"
3+
intellij-platform-plugin = "2.6.0"
44
apollo = "4.3.1"
5-
grammarkit = "2022.3.2.2"
6-
changelog = "2.2.1"
5+
grammarkit-plugin = "2022.3.2.2"
6+
changelog-plugin = "2.2.1"
77
sqlite-jdbc = "3.43.2.0"
88
apollo-normalizedcache = "1.0.0-alpha.3"
99
slf4j = "2.0.13"
1010
google-testparameterinjector = "1.11"
11+
cdimascio-dotenv = "6.4.1"
12+
atlassian-commonmark = "0.17.0"
13+
14+
# Corresponds to AS Meerkat Feature Drop 2024.3.2 Patch 1 -> https://plugins.jetbrains.com/docs/intellij/android-studio-releases-list.html
15+
# and https://developer.android.com/studio/archive (more up to date)
16+
# See also https://plugins.jetbrains.com/docs/intellij/android-studio.html
17+
intellij-platform-version = "2024.3.5"
1118

1219
[plugins]
1320
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin-plugin" }
14-
intellij-platform = { id = "org.jetbrains.intellij.platform", version.ref = "intellij-platform" }
21+
intellij-platform = { id = "org.jetbrains.intellij.platform", version.ref = "intellij-platform-plugin" }
22+
intellij-platform-module = { id = "org.jetbrains.intellij.platform.module", version.ref = "intellij-platform-plugin" }
1523
apollo = { id = "com.apollographql.apollo", version.ref = "apollo" }
16-
grammarkit = { id = "org.jetbrains.grammarkit", version.ref = "grammarkit" }
17-
changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
24+
grammarkit = { id = "org.jetbrains.grammarkit", version.ref = "grammarkit-plugin" }
25+
changelog = { id = "org.jetbrains.changelog", version.ref = "changelog-plugin" }
1826

1927
[libraries]
2028
apollo-annotations = { group = "com.apollographql.apollo", name = "apollo-annotations", version.ref = "apollo" }
@@ -28,3 +36,5 @@ apollo-normalized-cache-sqlite-new = { group = "com.apollographql.cache", name =
2836
sqlite-jdbc = { group = "org.xerial", name = "sqlite-jdbc", version.ref = "sqlite-jdbc" }
2937
slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" }
3038
google-testparameterinjector = { group = "com.google.testparameterinjector", name = "test-parameter-injector", version.ref = "google-testparameterinjector" }
39+
cdimascio-dotenv = { group = "io.github.cdimascio", name = "dotenv-kotlin", version.ref = "cdimascio-dotenv" }
40+
atlassian-commonmark = { group = "com.atlassian.commonmark", name = "commonmark", version.ref = "atlassian-commonmark" }

jsgraphql/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015-present, Jim Kynde Meyer
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

jsgraphql/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# GraphQL IntelliJ Plugin
2+
3+
This is a fork of the [JetBrains GraphQL](https://github.com/JetBrains/js-graphql-intellij-plugin) plugin.
4+
5+
The code was taken from the [`243` branch](https://github.com/JetBrains/js-graphql-intellij-plugin/tree/243).
6+
7+
## Acknowledgements
8+
9+
```
10+
The MIT License (MIT)
11+
12+
Copyright (c) 2015-present, Jim Kynde Meyer
13+
14+
Permission is hereby granted, free of charge, to any person obtaining a copy
15+
of this software and associated documentation files (the "Software"), to deal
16+
in the Software without restriction, including without limitation the rights
17+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18+
copies of the Software, and to permit persons to whom the Software is
19+
furnished to do so, subject to the following conditions:
20+
21+
The above copyright notice and this permission notice shall be included in all
22+
copies or substantial portions of the Software.
23+
24+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30+
SOFTWARE.
31+
```

jsgraphql/build.gradle.kts

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
plugins {
2+
alias(libs.plugins.kotlin.jvm)
3+
alias(libs.plugins.intellij.platform.module)
4+
alias(libs.plugins.grammarkit)
5+
}
6+
7+
repositories {
8+
mavenCentral()
9+
10+
intellijPlatform {
11+
defaultRepositories()
12+
}
13+
}
14+
15+
kotlin {
16+
jvmToolchain(21)
17+
}
18+
19+
sourceSets {
20+
main {
21+
java.srcDirs("src/main/gen", "src/main/java")
22+
}
23+
}
24+
25+
tasks {
26+
generateParser {
27+
purgeOldFiles.set(true)
28+
sourceFile.set(file("src/main/grammars/GraphQLParser.bnf"))
29+
targetRootOutputDir.set(file("src/main/gen"))
30+
pathToParser.set("com/intellij/lang/jsgraphql/GraphQLParser.java")
31+
pathToPsiRoot.set("com/intellij/lang/jsgraphql/psi")
32+
}
33+
generateLexer {
34+
purgeOldFiles.set(false)
35+
sourceFile.set(file("src/main/grammars/GraphQLLexer.flex"))
36+
targetOutputDir.set(file("src/main/gen/com/intellij/lang/jsgraphql"))
37+
38+
dependsOn("generateParser")
39+
}
40+
}
41+
42+
dependencies {
43+
intellijPlatform {
44+
intellijIdeaUltimate(libs.versions.intellij.platform.version.get())
45+
bundledPlugins(
46+
listOf(
47+
"org.jetbrains.kotlin",
48+
"com.intellij.modules.json",
49+
"org.jetbrains.plugins.yaml",
50+
"JavaScript",
51+
"org.intellij.intelliLang",
52+
)
53+
)
54+
}
55+
56+
implementation(libs.cdimascio.dotenv)
57+
implementation(libs.atlassian.commonmark)
58+
}

0 commit comments

Comments
 (0)