Skip to content

Commit e31f2f4

Browse files
authored
fix: migrate to built-in inline completion API from 2024.1 (#6947)
1 parent 9c688f5 commit e31f2f4

30 files changed

+367
-1608
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ extensions/intellij/.idea/**
158158
**/.idea/shelf/
159159
**/.idea/inspectionProfiles/Project_Default.xml
160160
**/.idea/php.xml
161+
**/.idea/kotlinc.xml
161162

162163

163164
extensions/intellij/bin

.idea/kotlinc.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

extensions/intellij/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ src/main/resources/bin
44
src/main/resources/config_schema.json
55
src/main/resources/continue_rc_schema.json
66
video
7+
.intellijPlatform
78
src/test/kotlin/com/github/continuedev/continueintellijextension/e2e/test-continue/*
89
!src/test/kotlin/com/github/continuedev/continueintellijextension/e2e/test-continue/config.json

extensions/intellij/.run/Run Extension.run.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
<option name="env">
55
<map>
66
<entry key="GUI_URL" value="http://localhost:5173/jetbrains_index.html"/>
7-
<entry key="ORG_GRADLE_PROJECT_platformVersion" value="2024.1"/>
87
<entry key="USE_TCP" value="true"/>
98
</map>
109
</option>
1110
<option name="executionName"/>
1211
<option name="externalProjectPath" value="$PROJECT_DIR$/extensions/intellij"/>
1312
<option name="externalSystemIdString" value="GRADLE"/>
14-
<option name="scriptParameters" value=""/>
13+
<option name="scriptParameters" value="" />
1514
<option name="taskDescriptions">
1615
<list/>
1716
</option>

extensions/intellij/build.gradle.kts

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,14 @@ import org.jetbrains.intellij.platform.gradle.tasks.PrepareSandboxTask
55
fun environment(key: String) = providers.environmentVariable(key)
66

77
val remoteRobotVersion = "0.11.23"
8-
val platformType: String by project
98
val platformVersion: String by project
109
val pluginGroup: String by project
1110
val pluginVersion: String by project
12-
val pluginSinceBuild: String by project
13-
val pluginRepositoryUrl: String by project
1411
val isEap get() = environment("RELEASE_CHANNEL").orNull == "eap"
1512

1613
plugins {
17-
kotlin("jvm") version "1.8.0"
18-
id("org.jetbrains.intellij.platform") version "2.6.0"
14+
kotlin("jvm") version "1.9.22"
15+
id("org.jetbrains.intellij.platform") version "2.7.2"
1916
id("org.jetbrains.changelog") version "2.1.2"
2017
id("org.jetbrains.qodana") version "0.1.13"
2118
id("org.jetbrains.kotlinx.kover") version "0.7.3"
@@ -34,50 +31,58 @@ repositories {
3431

3532
dependencies {
3633
intellijPlatform {
37-
create(platformType, platformVersion)
38-
plugins(listOf("org.jetbrains.plugins.terminal:223.8214.6"))
34+
create("IC", platformVersion)
35+
plugins(listOf("org.jetbrains.plugins.terminal:241.14494.150"))
3936
testFramework(TestFrameworkType.Platform)
4037
}
4138
implementation("com.posthog.java:posthog:1.2.0")
4239

40+
testImplementation("junit:junit:4.13.2")
4341
testImplementation("com.intellij.remoterobot:remote-robot:$remoteRobotVersion")
4442
testImplementation("com.intellij.remoterobot:remote-fixtures:$remoteRobotVersion")
45-
testImplementation("io.mockk:mockk:1.14.2")
43+
testImplementation("io.mockk:mockk:1.14.2") {
44+
// this transitive dependency (1.6.4) conflicts with built-in version (1.7.3)
45+
// otherwise e2e tests (runIdeForUiTests) will have linkage errors
46+
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
47+
}
4648
testImplementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
4749
testImplementation("com.automation-remarks:video-recorder-junit5:2.0")
48-
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3")
4950
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.10.0") // required to run both JUnit 5 and JUnit 3
5051
}
5152

52-
kotlin { jvmToolchain(17) }
53+
kotlin {
54+
jvmToolchain(17)
55+
}
5356

5457
intellijPlatform {
5558
pluginConfiguration {
5659
ideaVersion {
57-
sinceBuild = pluginSinceBuild
60+
sinceBuild = "241"
5861
}
5962
}
6063
pluginVerification {
6164
ides {
62-
ide("IC", "2025.1.4")
63-
ide("IC", "2022.3.3")
65+
ide("IC", "2025.2")
66+
ide("IC", "2025.1")
67+
ide("IC", "2024.3")
68+
ide("IC", "2024.2")
69+
ide("IC", "2024.1")
6470
}
6571
}
6672
}
6773

68-
changelog {
69-
groups.empty()
70-
repositoryUrl = pluginRepositoryUrl
71-
}
72-
7374
qodana {
7475
cachePath = provider { file(".qodana").canonicalPath }
7576
reportPath = provider { file("build/reports/inspections").canonicalPath }
7677
saveReport = true
7778
showReport = environment("QODANA_SHOW_REPORT").map { it.toBoolean() }.getOrElse(false)
7879
}
7980

80-
koverReport { defaults { xml { onCheck = true } } }
81+
koverReport {
82+
defaults {
83+
xml { onCheck = true }
84+
}
85+
}
8186

8287
intellijPlatformTesting {
8388
runIde {
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
pluginGroup=com.github.continuedev.continueintellijextension
2-
pluginRepositoryUrl=https://github.com/continuedev/continue
32
pluginVersion=1.0.38
4-
pluginSinceBuild=223
5-
platformType=IC
6-
platformVersion=2022.3.3
3+
platformVersion=2024.1
74
kotlin.stdlib.default.dependency=false
85
org.gradle.configuration-cache=true
96
org.gradle.caching=true

extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/actions/ContinueActionPromote.kt

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,14 @@
11
package com.github.continuedev.continueintellijextension.actions
22

3-
import com.github.continuedev.continueintellijextension.autocomplete.AcceptAutocompleteAction
4-
import com.github.continuedev.continueintellijextension.nextEdit.AcceptNextEditAction
5-
import com.github.continuedev.continueintellijextension.services.ContinueExtensionSettings
3+
64
import com.intellij.openapi.actionSystem.ActionPromoter
75
import com.intellij.openapi.actionSystem.AnAction
86
import com.intellij.openapi.actionSystem.DataContext
9-
import com.intellij.openapi.components.service
107
import org.jetbrains.annotations.NotNull
118

129
class ContinueActionPromote : ActionPromoter {
1310

1411
override fun promote(@NotNull actions: List<AnAction>, @NotNull context: DataContext): List<AnAction>? {
15-
// For autocomplete actions
16-
if (actions.any { it is AcceptAutocompleteAction }) {
17-
val settings = service<ContinueExtensionSettings>()
18-
if (settings.continueState.showIDECompletionSideBySide) {
19-
return actions.filterIsInstance<AcceptAutocompleteAction>()
20-
}
21-
}
22-
23-
if (actions.any { it is AcceptNextEditAction }) {
24-
val settings = service<ContinueExtensionSettings>()
25-
if (settings.continueState.showIDECompletionSideBySide) {
26-
return actions.filterIsInstance<AcceptNextEditAction>()
27-
}
28-
}
29-
3012
val rejectDiffActions = actions.filterIsInstance<RejectDiffAction>()
3113
if (rejectDiffActions.isNotEmpty()) {
3214
return rejectDiffActions

extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AcceptAutocompleteAction.kt

Lines changed: 0 additions & 25 deletions
This file was deleted.

extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteEditorListener.kt

Lines changed: 0 additions & 151 deletions
This file was deleted.

0 commit comments

Comments
 (0)