Merge branch 'main' into pe/jb-e2e-testing

This commit is contained in:
Test 2024-12-20 14:07:02 -08:00
commit f2f211c629
3 changed files with 6 additions and 10 deletions

View file

@ -30,6 +30,7 @@ import java.nio.file.Paths
import javax.swing.*
import com.intellij.openapi.components.service
import com.intellij.openapi.module.ModuleManager
import com.intellij.openapi.project.guessProjectDir
import com.intellij.openapi.roots.ModuleRootManager
import com.intellij.openapi.vfs.VirtualFileManager
import com.intellij.openapi.vfs.newvfs.BulkFileListener
@ -130,7 +131,6 @@ class ContinuePluginStartupActivity : StartupActivity, DumbAware {
val ideProtocolClient = IdeProtocolClient(
continuePluginService,
coroutineScope,
project.basePath,
project
)

View file

@ -32,10 +32,9 @@ import kotlin.coroutines.resume
class IdeProtocolClient(
private val continuePluginService: ContinuePluginService,
private val coroutineScope: CoroutineScope,
workspacePath: String?,
private val project: Project
) : DumbAware {
private val ide: IDE = IntelliJIDE(project, workspacePath, continuePluginService)
private val ide: IDE = IntelliJIDE(project, continuePluginService)
init {
// Setup config.json / config.ts save listeners
@ -389,7 +388,7 @@ class IdeProtocolClient(
ide.openUrl(url)
respond(null)
}
"insertAtCursor" -> {
val params = Gson().fromJson(
dataElement.toString(),

View file

@ -22,11 +22,13 @@ import com.intellij.openapi.extensions.PluginId
import com.intellij.openapi.fileEditor.FileDocumentManager
import com.intellij.openapi.fileEditor.FileEditorManager
import com.intellij.openapi.project.Project
import com.intellij.openapi.project.guessProjectDir
import com.intellij.openapi.util.IconLoader
import com.intellij.openapi.vfs.LocalFileSystem
import com.intellij.openapi.vfs.VirtualFileManager
import com.intellij.psi.PsiDocumentManager
import com.intellij.testFramework.LightVirtualFile
import com.intellij.util.containers.toArray
import kotlinx.coroutines.*
import java.awt.Desktop
import java.awt.Toolkit
@ -41,7 +43,6 @@ import java.nio.file.Paths
class IntelliJIDE(
private val project: Project,
private val workspacePath: String?,
private val continuePluginService: ContinuePluginService,
) : IDE {
@ -560,10 +561,6 @@ class IntelliJIDE(
return dirs
}
if (this.workspacePath != null) {
return arrayOf(this.workspacePath)
}
return arrayOf()
return listOfNotNull(project.guessProjectDir()?.url).toTypedArray()
}
}