add content level
This commit is contained in:
parent
7c8677fe39
commit
9545ccad2c
1 changed files with 13 additions and 3 deletions
|
|
@ -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" -> {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue