Skip to content

Commit

Permalink
Merge branch 'main' into pe/jb-e2e-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick-Erichsen committed Dec 20, 2024
2 parents db305fa + 94220e7 commit f2f211c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -130,7 +131,6 @@ class ContinuePluginStartupActivity : StartupActivity, DumbAware {
val ideProtocolClient = IdeProtocolClient(
continuePluginService,
coroutineScope,
project.basePath,
project
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -389,7 +388,7 @@ class IdeProtocolClient(
ide.openUrl(url)
respond(null)
}

"insertAtCursor" -> {
val params = Gson().fromJson(
dataElement.toString(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -41,7 +43,6 @@ import java.nio.file.Paths

class IntelliJIDE(
private val project: Project,
private val workspacePath: String?,
private val continuePluginService: ContinuePluginService,

) : IDE {
Expand Down Expand Up @@ -560,10 +561,6 @@ class IntelliJIDE(
return dirs
}

if (this.workspacePath != null) {
return arrayOf(this.workspacePath)
}

return arrayOf()
return listOfNotNull(project.guessProjectDir()?.url).toTypedArray()
}
}

0 comments on commit f2f211c

Please sign in to comment.