add content level

This commit is contained in:
Dallin Romney 2025-01-27 17:35:15 -08:00
parent 7c8677fe39
commit 9545ccad2c

View file

@ -54,6 +54,16 @@ class IdeProtocolClient(
val messageType = message.messageType
val dataElement = message.data
// A couple oddball messages respond directly to GUI, expect a different message format
// e.g. jetbrains/isOSREnabled
fun respondToWebview(content: Any) {
respond(mutableMapOf(
"done" to true,
"status" to "success",
"content" to content
))
}
try {
when (messageType) {
"showTutorial" -> {
@ -63,12 +73,12 @@ class IdeProtocolClient(
"jetbrains/isOSREnabled" -> {
val isOSREnabled =
ServiceManager.getService(ContinueExtensionSettings::class.java).continueState.enableOSR
respond(isOSREnabled)
respondToWebview(isOSREnabled)
}
"jetbrains/getColors" -> {
val colors = GetTheme().getTheme();
respond(colors)
respondToWebview(colors)
}
"jetbrains/onLoad" -> {
@ -78,7 +88,7 @@ class IdeProtocolClient(
"vscMachineId" to getMachineUniqueID(),
"vscMediaUrl" to "http://continue",
)
respond(jsonData)
respondToWebview(jsonData)
}
"getIdeSettings" -> {