Skip to content

Commit 3a9e87c

Browse files
authored
fix(amazonq): fix LinkageError when starting AmazonQLspService (#5618)
In certain IDE environments, for example when user has the latest Scala plugin, Amazon Q attempts to load lsp4j through transitive optional dependencies instead of through the IDE. Ideally we do not bundle the library, but this is not possible until JetBrains can guarantee stronger isolation between plugins
1 parent 626038d commit 3a9e87c

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Fix LinkageError while attempting to do Amazon Q inline suggestions in certain environments"
4+
}

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ junit5 = "5.11.0"
2222
kotlin = "2.0.0"
2323
# set in <root>/settings.gradle.kts
2424
kotlinCoroutines = "1.8.0"
25+
lsp4j = "0.24.0"
2526
mockito = "5.12.0"
2627
mockitoKotlin = "5.4.0"
2728
mockk = "1.13.17"
@@ -105,6 +106,7 @@ kotlin-coroutinesTest = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-tes
105106
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
106107
kotlin-stdLibJdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
107108
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
109+
lsp4j = { module = "org.eclipse.lsp4j:org.eclipse.lsp4j", version.ref = "lsp4j" }
108110
mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockito" }
109111
mockito-junit-jupiter = { module = "org.mockito:mockito-junit-jupiter", version.ref = "mockito" }
110112
mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version.ref = "mockitoKotlin" }

plugins/amazonq/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ dependencies {
3636
implementation(project(":plugin-amazonq:codewhisperer"))
3737
implementation(project(":plugin-amazonq:mynah-ui"))
3838
implementation(project(":plugin-amazonq:shared"))
39+
implementation(libs.lsp4j)
3940

4041
testImplementation(project(":plugin-core"))
4142
}

0 commit comments

Comments
 (0)