update intellij ide

This commit is contained in:
Test 2024-12-17 11:17:16 -08:00
parent 49c5a538f6
commit 07d03ceef7
4 changed files with 5 additions and 21 deletions

View file

@ -173,7 +173,7 @@ class ContinuePluginStartupActivity : StartupActivity, DumbAware {
// Collect all relevant URIs for content changes
val changedURIs = events.filterIsInstance<VFileContentChangeEvent>()
.map { event -> event.file.url }
// Send "files/changed" message if there are any content changes
if (changedURIs.isNotEmpty()) {
val data = mapOf("files" to changedURIs)
@ -220,12 +220,10 @@ class ContinuePluginStartupActivity : StartupActivity, DumbAware {
// Reload the WebView
continuePluginService?.let { pluginService ->
val allModulePaths = ModuleManager.getInstance(project).modules
.flatMap { module -> ModuleRootManager.getInstance(module).contentRoots.map { it.path } }
.map { Paths.get(it).normalize() }
.flatMap { module -> ModuleRootManager.getInstance(module).contentRoots.map { it.url } }
val topLevelModulePaths = allModulePaths
.filter { modulePath -> allModulePaths.none { it != modulePath && modulePath.startsWith(it) } }
.map { it.toString() }
pluginService.workspacePaths = topLevelModulePaths.toTypedArray()
}

View file

@ -390,11 +390,6 @@ class IdeProtocolClient(
respond(null)
}
"pathSep" -> {
val sep = ide.pathSep()
respond(sep)
}
"insertAtCursor" -> {
val params = Gson().fromJson(
dataElement.toString(),

View file

@ -1,6 +1,5 @@
import com.github.continuedev.continueintellijextension.*
import com.github.continuedev.continueintellijextension.constants.getContinueGlobalPath
import com.github.continuedev.continueintellijextension.`continue`.DiffManager
import com.github.continuedev.continueintellijextension.services.ContinueExtensionSettings
import com.github.continuedev.continueintellijextension.services.ContinuePluginService
import com.github.continuedev.continueintellijextension.utils.OS
@ -178,16 +177,14 @@ class IntelliJIDE(
val configs = mutableListOf<String>()
for (workspaceDir in workspaceDirs) {
val workspacePath = File(workspaceDir)
val dir = VirtualFileManager.getInstance().findFileByUrl("file://$workspacePath")
val dir = VirtualFileManager.getInstance().findFileByUrl(workspaceDir)
if (dir != null) {
val contents = dir.children.map { it.name }
val contents = dir.children.map { it.url }
// Find any .continuerc.json files
for (file in contents) {
if (file.endsWith(".continuerc.json")) {
val filePath = workspacePath.resolve(file)
val fileContent = File(filePath.toString()).readText()
val fileContent = File(URI(file)).readText()
configs.add(fileContent)
}
}
@ -540,10 +537,6 @@ class IntelliJIDE(
throw NotImplementedError("onDidChangeActiveTextEditor not implemented yet")
}
override suspend fun pathSep(): String {
return File.separator
}
private fun setFileOpen(filepath: String, open: Boolean = true) {
val file = LocalFileSystem.getInstance().findFileByPath(filepath)

View file

@ -115,8 +115,6 @@ interface IDE {
suspend fun getAvailableThreads(): List<Thread>
suspend fun listFolders(): List<String>
suspend fun getWorkspaceDirs(): List<String>
suspend fun getWorkspaceConfigs(): List<ContinueRcJson>