diff --git a/platform/xdebugger-impl/backend/src/com/intellij/platform/debugger/impl/backend/BackendXDebuggerValueMarkupApi.kt b/platform/xdebugger-impl/backend/src/com/intellij/platform/debugger/impl/backend/BackendXDebuggerValueMarkupApi.kt index 7b32b9d1d623..0a9c3f2e4bd5 100644 --- a/platform/xdebugger-impl/backend/src/com/intellij/platform/debugger/impl/backend/BackendXDebuggerValueMarkupApi.kt +++ b/platform/xdebugger-impl/backend/src/com/intellij/platform/debugger/impl/backend/BackendXDebuggerValueMarkupApi.kt @@ -1,6 +1,7 @@ // Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.platform.debugger.impl.backend +import com.intellij.ide.ui.colors.color import com.intellij.platform.debugger.impl.rpc.XDebuggerValueMarkupApi import com.intellij.platform.debugger.impl.rpc.XValueMarkerDto import com.intellij.ui.JBColor @@ -20,7 +21,7 @@ internal class BackendXDebuggerValueMarkupApi : XDebuggerValueMarkupApi { val session = xValueModel.session val markers = session.getValueMarkers() ?: return - val markup = ValueMarkup(markerDto.text, markerDto.color ?: JBColor.RED, markerDto.tooltipText) + val markup = ValueMarkup(markerDto.text, markerDto.colorId?.color() ?: JBColor.RED, markerDto.tooltipText) markers.markValue(xValueModel.xValue, markup).await() updateMarkersForAllXValueModels(markers, session) } diff --git a/platform/xdebugger-impl/frontend/src/com/intellij/platform/debugger/impl/frontend/FrontendXValueMarkers.kt b/platform/xdebugger-impl/frontend/src/com/intellij/platform/debugger/impl/frontend/FrontendXValueMarkers.kt index 55592bd30fe6..8adf3109876d 100644 --- a/platform/xdebugger-impl/frontend/src/com/intellij/platform/debugger/impl/frontend/FrontendXValueMarkers.kt +++ b/platform/xdebugger-impl/frontend/src/com/intellij/platform/debugger/impl/frontend/FrontendXValueMarkers.kt @@ -1,13 +1,14 @@ // Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.platform.debugger.impl.frontend +import com.intellij.ide.ui.colors.color +import com.intellij.ide.ui.colors.rpcId import com.intellij.openapi.components.Service import com.intellij.openapi.components.service import com.intellij.openapi.project.Project import com.intellij.platform.debugger.impl.frontend.evaluate.quick.FrontendXValue import com.intellij.platform.debugger.impl.rpc.XDebuggerValueMarkupApi import com.intellij.platform.debugger.impl.rpc.XValueMarkerDto -import com.intellij.ui.JBColor import com.intellij.xdebugger.frame.XValue import com.intellij.xdebugger.impl.frame.XDebugManagerProxy import com.intellij.xdebugger.impl.frame.XDebugSessionProxy @@ -23,8 +24,7 @@ import org.jetbrains.concurrency.asPromise internal class FrontendXValueMarkers(private val project: Project) : XValueMarkers() { override fun getMarkup(value: XValue): ValueMarkup? { val markerDto = FrontendXValue.asFrontendXValueOrNull(value)?.markerDto ?: return null - // TODO[IJPL-160146]: Implement implement Color serialization - return ValueMarkup(markerDto.text, markerDto.color ?: JBColor.RED, markerDto.tooltipText) + return ValueMarkup(markerDto.text, markerDto.colorId?.color(), markerDto.tooltipText) } override fun canMarkValue(value: XValue): Boolean { @@ -54,7 +54,7 @@ internal class FrontendXValueMarkers(private val project: Project private class FrontendXValueMarkersService(project: Project, private val cs: CoroutineScope) { fun markValue(value: XValue, markup: ValueMarkup): Promise { val valueMarked = cs.async { - val marker = XValueMarkerDto(markup.text, markup.color, markup.toolTipText) + val marker = XValueMarkerDto(markup.text, markup.color.rpcId(), markup.toolTipText) XDebuggerValueMarkupApi.getInstance().markValue(FrontendXValue.asFrontendXValue(value).xValueDto.id, marker) marker as Any } diff --git a/platform/xdebugger-impl/rpc/src/com/intellij/platform/debugger/impl/rpc/XValueMarkerDto.kt b/platform/xdebugger-impl/rpc/src/com/intellij/platform/debugger/impl/rpc/XValueMarkerDto.kt index 705e674e8949..aad28ba9780f 100644 --- a/platform/xdebugger-impl/rpc/src/com/intellij/platform/debugger/impl/rpc/XValueMarkerDto.kt +++ b/platform/xdebugger-impl/rpc/src/com/intellij/platform/debugger/impl/rpc/XValueMarkerDto.kt @@ -1,10 +1,10 @@ // Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.platform.debugger.impl.rpc +import com.intellij.ide.ui.colors.ColorId import kotlinx.serialization.Serializable -import kotlinx.serialization.Transient -import java.awt.Color +import org.jetbrains.annotations.ApiStatus -// TODO[IJPL-160146]: Implement implement Color serialization +@ApiStatus.Internal @Serializable -data class XValueMarkerDto(val text: String, @Transient val color: Color? = null, val tooltipText: String?) \ No newline at end of file +data class XValueMarkerDto(val text: String, val colorId: ColorId?, val tooltipText: String?) \ No newline at end of file diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/handlers/XMarkObjectActionHandler.kt b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/handlers/XMarkObjectActionHandler.kt index e414ee463d5d..c357eaa1e988 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/handlers/XMarkObjectActionHandler.kt +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/handlers/XMarkObjectActionHandler.kt @@ -1,6 +1,7 @@ // Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.xdebugger.impl.actions.handlers +import com.intellij.ide.ui.colors.rpcId import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.PlatformCoreDataKeys import com.intellij.openapi.application.EDT @@ -97,7 +98,7 @@ private suspend fun performMarkObject( return false } XDebugManagerProxy.getInstance().withId(value, proxy) { xValueId -> - val marker = XValueMarkerDto(markup.text, markup.color, markup.toolTipText) + val marker = XValueMarkerDto(markup.text, markup.color.rpcId(), markup.toolTipText) XDebuggerValueMarkupApi.getInstance().markValue(xValueId, marker) } } diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/rpc/models/BackendXValueModel.kt b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/rpc/models/BackendXValueModel.kt index a042704b4d91..bc417246bc65 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/rpc/models/BackendXValueModel.kt +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/rpc/models/BackendXValueModel.kt @@ -1,6 +1,7 @@ // Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.xdebugger.impl.rpc.models +import com.intellij.ide.ui.colors.rpcId import com.intellij.ide.ui.icons.rpcId import com.intellij.openapi.components.Service import com.intellij.openapi.components.service @@ -15,6 +16,7 @@ import com.intellij.platform.kernel.ids.BackendValueIdType import com.intellij.platform.kernel.ids.deleteValueById import com.intellij.platform.kernel.ids.findValueById import com.intellij.platform.kernel.ids.storeValueGlobally +import com.intellij.ui.JBColor import com.intellij.util.AwaitCancellationAndInvoke import com.intellij.util.awaitCancellationAndInvoke import com.intellij.xdebugger.frame.XFullValueEvaluator @@ -107,7 +109,7 @@ class BackendXValueModel internal constructor( _marker.value = null return } - _marker.update { XValueMarkerDto(marker.text, marker.color, marker.toolTipText) } + _marker.update { XValueMarkerDto(marker.text, (marker.color ?: JBColor.RED).rpcId(), marker.toolTipText) } } @ApiStatus.Internal