дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 11:15:40 +02:00
feat(plugins): import IntelliJ theme plugins (#1184)
Settings › Plugins (gear menu) gets Import Theme from IntelliJ IDE… (theme plugins of the JetBrains IDEs on this machine, the one each IDE uses first) and Import IntelliJ Theme from File… (a Marketplace .jar / .zip or a .theme.json). The host reads the plugin with size limits; the UI converts it with the IntelliJ mapping (moved from scripts/theme to src/features/plugins/intellijTheme.ts, still used by pnpm theme:import-intellij) into one OpenIDEA theme plugin (engines.openidea ^1.0) with all of its themes, installed through the usual install page, and applies the chosen theme. Theme pickers separate each plugin's themes, and Quick Switch Scheme › Theme previews the theme under the pointer or keyboard after 500 ms and restores the selected one when closed without a choice. Co-authored-by: ldg030201 <[email protected]>
Цей коміт міститься в:
1 джерело
a610982655
коміт
6dec1252db
33 files changed
+2284
-87
No files matched your search
@@ -457,6 +457,9 @@ pub fn builder() -> tauri_specta::Builder<tauri::Wry> {
|
||||
plugin::plugin_set_market_url,
|
||||
plugin::plugin_market_download,
|
||||
plugin::plugin_unpack_package,
|
||||
plugin::plugin_read_intellij_theme,
|
||||
plugin::plugin_installed_intellij_themes,
|
||||
plugin::plugin_stage_package,
|
||||
plugin::plugin_roll_back,
|
||||
plugin::plugin_secrets,
|
||||
plugin::plugin_set_secret,
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
use crate::state::AppState;
|
||||
use ide_core::{IdeError, IdeResult};
|
||||
use ide_extension::ActivationEvent;
|
||||
use ide_host::plugins::intellij::{self, InstalledIntellijTheme, IntellijThemeSource};
|
||||
use ide_host::plugins::{
|
||||
ActiveTheme, CatalogPlugin, Consent, EventKind, HostWorkspace, InstallPreview, PluginEditor, PluginEvent,
|
||||
PluginHost, PluginInfo, PluginStatusItem, PluginsSnapshot, WorkbenchEvent,
|
||||
ActiveTheme, CatalogPlugin, Consent, EventKind, HostWorkspace, InstallPreview, PackageFile, PluginEditor,
|
||||
PluginEvent, PluginHost, PluginInfo, PluginStatusItem, PluginsSnapshot, WorkbenchEvent,
|
||||
};
|
||||
use ide_plugin::{Invocation, Limits};
|
||||
use parking_lot::Mutex;
|
||||
@@ -512,6 +513,32 @@ pub async fn plugin_unpack_package(state: State<'_, AppState>, path: PathBuf) ->
|
||||
blocking(move || host.unpack_package(&path)).await
|
||||
}
|
||||
|
||||
/// Reads an IntelliJ theme plugin (`.jar`, Marketplace `.zip`, plugin folder) or `.theme.json` to import.
|
||||
#[tauri::command]
|
||||
#[specta::specta]
|
||||
pub async fn plugin_read_intellij_theme(path: PathBuf) -> IdeResult<IntellijThemeSource> {
|
||||
blocking(move || intellij::read_source(&path)).await
|
||||
}
|
||||
|
||||
/// Theme plugins installed in the JetBrains IDEs of this user, the ones in use first.
|
||||
#[tauri::command]
|
||||
#[specta::specta]
|
||||
pub async fn plugin_installed_intellij_themes() -> IdeResult<Vec<InstalledIntellijTheme>> {
|
||||
blocking(|| Ok(intellij::installed_themes())).await
|
||||
}
|
||||
|
||||
/// Writes a package the UI generated (an imported theme); returns the folder for the install page.
|
||||
#[tauri::command]
|
||||
#[specta::specta]
|
||||
pub async fn plugin_stage_package(
|
||||
state: State<'_, AppState>,
|
||||
name: String,
|
||||
files: Vec<PackageFile>,
|
||||
) -> IdeResult<PathBuf> {
|
||||
let host = state.plugins.clone();
|
||||
blocking(move || host.stage_package(&name, &files)).await
|
||||
}
|
||||
|
||||
/// Goes back to the version the last update of `id` replaced.
|
||||
#[tauri::command]
|
||||
#[specta::specta]
|
||||
|
||||
Reference in new issue
Заблокувати користувача