Skip to content

The IDE you know, rebuilt in Rust. IntelliJ IDEA–style keymap, tool windows and search-everywhere in a fast native app: editor, code insight, debugger, Git, terminal, database and HTTP clients for 60+ languages.

fix(desktop): pass the real window label to project-requiring commands (#960)

arookieofc18e16e76a409
diff --git a/src-tauri/src/commands/debug.rs b/src-tauri/src/commands/debug.rs
index d9cffa65e..eb2134609 100644
--- a/src-tauri/src/commands/debug.rs
+++ b/src-tauri/src/commands/debug.rs
@@ -261,12 +261,13 @@ pub async fn debug_attachable_processes(state: State<'_, AppState>) -> IdeResult
#[tauri::command]
#[specta::specta]
pub async fn debug_listen_for_jvm(
+ window: Window,
state: State<'_, AppState>,
request: ide_core::RequestId,
host: String,
port: u16,
) -> IdeResult<u16> {
- ide_host::ops::debug::debug_listen_for_jvm(&state.host, "", request, host, port).await
+ ide_host::ops::debug::debug_listen_for_jvm(&state.host, window.label(), request, host, port).await
}
/// HotSwap (Reload Changed Classes) in a java-debug session.
diff --git a/src-tauri/src/commands/sdk.rs b/src-tauri/src/commands/sdk.rs
index 92a8ea471..050c2c101 100644
--- a/src-tauri/src/commands/sdk.rs
+++ b/src-tauri/src/commands/sdk.rs
@@ -39,17 +39,19 @@ pub async fn sdk_project_libraries(
#[tauri::command]
#[specta::specta]
pub async fn sdk_locate_tools(
+ window: Window,
state: State<'_, AppState>,
names: Vec<String>,
near: Option<PathBuf>,
) -> IdeResult<LocatedTools> {
- ide_host::ops::sdk::sdk_locate_tools(&state.host, "", names, near).await
+ ide_host::ops::sdk::sdk_locate_tools(&state.host, window.label(), names, near).await
}
/// `base -m venv location`; output lines stream through `on_output`.
#[tauri::command]
#[specta::specta]
pub async fn sdk_python_create_venv(
+ window: Window,
state: State<'_, AppState>,
base: PathBuf,
location: PathBuf,
@@ -58,7 +60,7 @@ pub async fn sdk_python_create_venv(
) -> IdeResult<Sdk> {
ide_host::ops::sdk::sdk_python_create_venv(
&state.host,
- "",
+ window.label(),
base,
location,
request,
@@ -70,17 +72,20 @@ pub async fn sdk_python_create_venv(
#[tauri::command]
#[specta::specta]
pub async fn sdk_python_packages(
+ window: Window,
state: State<'_, AppState>,
python: PathBuf,
request: RequestId,
) -> IdeResult<Vec<PythonPackage>> {
- ide_host::ops::sdk::sdk_python_packages(&state.host, "", python, request).await
+ ide_host::ops::sdk::sdk_python_packages(&state.host, window.label(), python, request).await
}
/// Installs (`uninstall = false`) or removes a package; output streams through `on_output`.
#[tauri::command]
#[specta::specta]
+#[allow(clippy::too_many_arguments)]
pub async fn sdk_python_pip(
+ window: Window,
state: State<'_, AppState>,
python: PathBuf,
requirement: String,
@@ -91,7 +96,7 @@ pub async fn sdk_python_pip(
) -> IdeResult<()> {
ide_host::ops::sdk::sdk_python_pip(
&state.host,
- "",
+ window.label(),
python,
requirement,
uninstall,
diff --git a/src-tauri/src/commands/vcs.rs b/src-tauri/src/commands/vcs.rs
index 305fd0e8c..0e06e2f5e 100644
--- a/src-tauri/src/commands/vcs.rs
+++ b/src-tauri/src/commands/vcs.rs
@@ -371,8 +371,8 @@ pub async fn vcs_init(state: State<'_, AppState>, dir: PathBuf) -> IdeResult<()>
/// executable when `path` is empty.
#[tauri::command]
#[specta::specta]
-pub async fn vcs_git_version(state: State<'_, AppState>, path: String) -> IdeResult<GitExecutableInfo> {
- ide_host::ops::vcs::vcs_git_version(&state.host, "", path).await
+pub async fn vcs_git_version(window: Window, state: State<'_, AppState>, path: String) -> IdeResult<GitExecutableInfo> {
+ ide_host::ops::vcs::vcs_git_version(&state.host, window.label(), path).await
}
/// The auto-detected git executable (shown as the field's placeholder).
@@ -656,8 +656,13 @@ pub fn vcs_changelists_save(window: Window, state: State<'_, AppState>, changeli
/// Create Patch › Save to file.
#[tauri::command]
#[specta::specta]
-pub async fn vcs_write_patch(state: State<'_, AppState>, path: PathBuf, patch: String) -> IdeResult<()> {
- ide_host::ops::vcs::vcs_write_patch(&state.host, "", path, patch).await
+pub async fn vcs_write_patch(
+ window: Window,
+ state: State<'_, AppState>,
+ path: PathBuf,
+ patch: String,
+) -> IdeResult<()> {
+ ide_host::ops::vcs::vcs_write_patch(&state.host, window.label(), path, patch).await
}
#[tauri::command]