bugfix: remove esbuild permission setting
This commit is contained in:
parent
2b87a1685d
commit
dd61c4dff6
5 changed files with 74 additions and 64 deletions
1
.github/workflows/jetbrains-release.yaml
vendored
1
.github/workflows/jetbrains-release.yaml
vendored
|
|
@ -320,7 +320,6 @@ jobs:
|
|||
chmod +x continue-binary
|
||||
chmod +x build/Release/node_sqlite3.node
|
||||
chmod +x index.node
|
||||
chmod +x esbuild
|
||||
if: ${{ matrix.platform }} != 'win32'
|
||||
|
||||
# Run tests for binary
|
||||
|
|
|
|||
17
extensions/intellij/.run/Tail Dev Logs.run.xml
Normal file
17
extensions/intellij/.run/Tail Dev Logs.run.xml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Tail Dev Logs" type="ShConfigurationType">
|
||||
<option name="SCRIPT_TEXT" value="tail ./binary/.continue/logs/core.log" />
|
||||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||
<option name="SCRIPT_PATH" value="" />
|
||||
<option name="SCRIPT_OPTIONS" value="" />
|
||||
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
||||
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
||||
<option name="INTERPRETER_PATH" value="/bin/zsh" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="EXECUTE_IN_TERMINAL" value="false" />
|
||||
<option name="EXECUTE_SCRIPT_FILE" value="false" />
|
||||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
|
|
@ -3,7 +3,7 @@ pluginGroup=com.github.continuedev.continueintellijextension
|
|||
pluginName=continue-intellij-extension
|
||||
pluginRepositoryUrl=https://github.com/continuedev/continue
|
||||
# SemVer format -> https://semver.org
|
||||
pluginVersion=0.0.76
|
||||
pluginVersion=0.0.77
|
||||
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
|
||||
pluginSinceBuild=223
|
||||
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import kotlinx.coroutines.*
|
|||
|
||||
class CoreMessenger(
|
||||
private val project: Project,
|
||||
esbuildPath: String,
|
||||
continueCorePath: String,
|
||||
private val ideProtocolClient: IdeProtocolClient,
|
||||
coroutineScope: CoroutineScope
|
||||
|
|
@ -162,10 +161,7 @@ class CoreMessenger(
|
|||
}
|
||||
} else {
|
||||
// Set proper permissions
|
||||
coroutineScope.launch(Dispatchers.IO) {
|
||||
setPermissions(continueCorePath)
|
||||
setPermissions(esbuildPath)
|
||||
}
|
||||
coroutineScope.launch(Dispatchers.IO) { setPermissions(continueCorePath) }
|
||||
|
||||
// Start the subprocess
|
||||
val processBuilder =
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ import com.intellij.openapi.components.ServiceManager
|
|||
import com.intellij.openapi.components.service
|
||||
import com.intellij.openapi.extensions.PluginId
|
||||
import com.intellij.openapi.project.Project
|
||||
import kotlinx.coroutines.*
|
||||
import java.nio.file.Paths
|
||||
import kotlinx.coroutines.*
|
||||
|
||||
class CoreMessengerManager(
|
||||
private val project: Project,
|
||||
|
|
@ -16,69 +16,67 @@ class CoreMessengerManager(
|
|||
private val coroutineScope: CoroutineScope
|
||||
) {
|
||||
|
||||
var coreMessenger: CoreMessenger? = null
|
||||
var lastBackoffInterval = 0.5
|
||||
var coreMessenger: CoreMessenger? = null
|
||||
var lastBackoffInterval = 0.5
|
||||
|
||||
init {
|
||||
coroutineScope.launch {
|
||||
val continuePluginService = ServiceManager.getService(
|
||||
project,
|
||||
ContinuePluginService::class.java
|
||||
)
|
||||
init {
|
||||
coroutineScope.launch {
|
||||
val continuePluginService =
|
||||
ServiceManager.getService(project, ContinuePluginService::class.java)
|
||||
|
||||
val myPluginId = "com.github.continuedev.continueintellijextension"
|
||||
val pluginDescriptor =
|
||||
PluginManager.getPlugin(PluginId.getId(myPluginId)) ?: throw Exception("Plugin not found")
|
||||
val myPluginId = "com.github.continuedev.continueintellijextension"
|
||||
val pluginDescriptor =
|
||||
PluginManager.getPlugin(PluginId.getId(myPluginId)) ?: throw Exception("Plugin not found")
|
||||
|
||||
val pluginPath = pluginDescriptor.pluginPath
|
||||
val osName = System.getProperty("os.name").toLowerCase()
|
||||
val os = when {
|
||||
osName.contains("mac") || osName.contains("darwin") -> "darwin"
|
||||
osName.contains("win") -> "win32"
|
||||
osName.contains("nix") || osName.contains("nux") || osName.contains("aix") -> "linux"
|
||||
else -> "linux"
|
||||
}
|
||||
val osArch = System.getProperty("os.arch").toLowerCase()
|
||||
val arch = when {
|
||||
osArch.contains("aarch64") || (osArch.contains("arm") && osArch.contains("64")) -> "arm64"
|
||||
osArch.contains("amd64") || osArch.contains("x86_64") -> "x64"
|
||||
else -> "x64"
|
||||
}
|
||||
val target = "$os-$arch"
|
||||
val pluginPath = pluginDescriptor.pluginPath
|
||||
val osName = System.getProperty("os.name").toLowerCase()
|
||||
val os =
|
||||
when {
|
||||
osName.contains("mac") || osName.contains("darwin") -> "darwin"
|
||||
osName.contains("win") -> "win32"
|
||||
osName.contains("nix") || osName.contains("nux") || osName.contains("aix") -> "linux"
|
||||
else -> "linux"
|
||||
}
|
||||
val osArch = System.getProperty("os.arch").toLowerCase()
|
||||
val arch =
|
||||
when {
|
||||
osArch.contains("aarch64") || (osArch.contains("arm") && osArch.contains("64")) ->
|
||||
"arm64"
|
||||
osArch.contains("amd64") || osArch.contains("x86_64") -> "x64"
|
||||
else -> "x64"
|
||||
}
|
||||
val target = "$os-$arch"
|
||||
|
||||
println("Identified OS: $os, Arch: $arch")
|
||||
println("Identified OS: $os, Arch: $arch")
|
||||
|
||||
val corePath = Paths.get(pluginPath.toString(), "core").toString()
|
||||
val targetPath = Paths.get(corePath, target).toString()
|
||||
val continueCorePath =
|
||||
Paths.get(targetPath, "continue-binary" + (if (os == "win32") ".exe" else "")).toString()
|
||||
val corePath = Paths.get(pluginPath.toString(), "core").toString()
|
||||
val targetPath = Paths.get(corePath, target).toString()
|
||||
val continueCorePath =
|
||||
Paths.get(targetPath, "continue-binary" + (if (os == "win32") ".exe" else "")).toString()
|
||||
|
||||
// esbuild needs permissions
|
||||
val esbuildPath = Paths.get(targetPath, "esbuild" + (if (os == "win32") ".exe" else "")).toString()
|
||||
setupCoreMessenger(continueCorePath)
|
||||
}
|
||||
}
|
||||
|
||||
setupCoreMessenger(esbuildPath, continueCorePath)
|
||||
}
|
||||
private fun setupCoreMessenger(continueCorePath: String): Unit {
|
||||
coreMessenger = CoreMessenger(project, continueCorePath, ideProtocolClient, coroutineScope)
|
||||
|
||||
coreMessenger?.request("config/getSerializedProfileInfo", null, null) { resp ->
|
||||
val data = resp as? Map<String, Any>
|
||||
val profileInfo = data?.get("config") as? Map<String, Any>
|
||||
val allowAnonymousTelemetry = profileInfo?.get("allowAnonymousTelemetry") as? Boolean
|
||||
val telemetryService = service<TelemetryService>()
|
||||
if (allowAnonymousTelemetry == true || allowAnonymousTelemetry == null) {
|
||||
telemetryService.setup(getMachineUniqueID())
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupCoreMessenger(esbuildPath: String, continueCorePath: String): Unit {
|
||||
coreMessenger = CoreMessenger(project, esbuildPath, continueCorePath, ideProtocolClient, coroutineScope)
|
||||
|
||||
coreMessenger?.request("config/getSerializedProfileInfo", null, null) { resp ->
|
||||
val data = resp as? Map<String, Any>
|
||||
val profileInfo = data?.get("config") as? Map<String, Any>
|
||||
val allowAnonymousTelemetry = profileInfo?.get("allowAnonymousTelemetry") as? Boolean
|
||||
val telemetryService = service<TelemetryService>()
|
||||
if (allowAnonymousTelemetry == true || allowAnonymousTelemetry == null) {
|
||||
telemetryService.setup(getMachineUniqueID())
|
||||
}
|
||||
}
|
||||
|
||||
// On exit, use exponential backoff to create another CoreMessenger
|
||||
coreMessenger?.onDidExit {
|
||||
lastBackoffInterval *= 2
|
||||
println("CoreMessenger exited, retrying in $lastBackoffInterval seconds")
|
||||
Thread.sleep((lastBackoffInterval * 1000).toLong())
|
||||
setupCoreMessenger(esbuildPath, continueCorePath)
|
||||
}
|
||||
// On exit, use exponential backoff to create another CoreMessenger
|
||||
coreMessenger?.onDidExit {
|
||||
lastBackoffInterval *= 2
|
||||
println("CoreMessenger exited, retrying in $lastBackoffInterval seconds")
|
||||
Thread.sleep((lastBackoffInterval * 1000).toLong())
|
||||
setupCoreMessenger(continueCorePath)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue