debugger_ui: Move DEBUGGER_PANEL_PREFIX out of db (#28768)

This PR moves the `DEBUGGER_PANEL_PREFIX` constant out of the `db` crate
and into `debugger_ui`, since it is specific to that.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-04-15 10:59:42 -04:00 committed by GitHub
parent 5e094553fa
commit 6f0951ff77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 7 deletions

View file

@ -1,7 +1,6 @@
use sqlez_macros::sql;
use crate::{define_connection, query};
pub static DEBUGGER_PANEL_PREFIX: &str = "debugger_panel_";
define_connection!(pub static ref KEY_VALUE_STORE: KeyValueStore<()> =
&[sql!(

View file

@ -52,6 +52,8 @@ pub(crate) struct SerializedPane {
pub active_item: Option<DebuggerPaneItem>,
}
const DEBUGGER_PANEL_PREFIX: &str = "debugger_panel_";
pub(crate) async fn serialize_pane_layout(
adapter_name: SharedString,
pane_group: SerializedPaneLayout,
@ -59,7 +61,7 @@ pub(crate) async fn serialize_pane_layout(
if let Ok(serialized_pane_group) = serde_json::to_string(&pane_group) {
KEY_VALUE_STORE
.write_kvp(
format!("{}-{adapter_name}", db::kvp::DEBUGGER_PANEL_PREFIX),
format!("{DEBUGGER_PANEL_PREFIX}-{adapter_name}"),
serialized_pane_group,
)
.await
@ -116,11 +118,7 @@ fn serialize_pane(pane: &Entity<Pane>, cx: &mut App) -> SerializedPane {
pub(crate) async fn get_serialized_pane_layout(
adapter_name: impl AsRef<str>,
) -> Option<SerializedPaneLayout> {
let key = format!(
"{}-{}",
db::kvp::DEBUGGER_PANEL_PREFIX,
adapter_name.as_ref()
);
let key = format!("{DEBUGGER_PANEL_PREFIX}-{}", adapter_name.as_ref());
KEY_VALUE_STORE
.read_kvp(&key)