From 8b9616837df289d4f38a1a868dbd6ed3e4390d90 Mon Sep 17 00:00:00 2001 From: yhh <359807859@qq.com> Date: Thu, 20 Nov 2025 09:51:29 +0800 Subject: [PATCH] =?UTF-8?q?style(editor-app):=20=E7=A7=BB=E9=99=A4log?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/app/managers/PluginInstaller.ts | 5 --- .../src/core/bootstrap/EditorBootstrap.ts | 10 ----- .../src/plugins/SceneInspectorPlugin.ts | 9 ---- .../editor-app/src/services/GitHubService.ts | 26 +----------- .../src/services/PluginBuildService.ts | 1 - .../editor-app/src/services/PluginLoader.ts | 37 ---------------- .../src/services/PluginMarketService.ts | 42 ++----------------- .../src/services/PluginPublishService.ts | 8 ---- .../src/services/PluginSourceParser.ts | 4 -- packages/editor-app/src/utils/updater.ts | 8 ---- packages/editor-app/vite.config.ts | 2 - .../src/Plugins/EditorPluginManager.ts | 3 -- .../src/Services/CompilerRegistry.ts | 2 - .../src/Services/FileActionRegistry.ts | 8 ---- .../src/Services/WindowRegistry.ts | 3 -- 15 files changed, 4 insertions(+), 164 deletions(-) diff --git a/packages/editor-app/src/app/managers/PluginInstaller.ts b/packages/editor-app/src/app/managers/PluginInstaller.ts index 4372b792..c6d5750a 100644 --- a/packages/editor-app/src/app/managers/PluginInstaller.ts +++ b/packages/editor-app/src/app/managers/PluginInstaller.ts @@ -5,8 +5,6 @@ import { EditorAppearancePlugin } from '../../plugins/EditorAppearancePlugin'; export class PluginInstaller { async installBuiltinPlugins(pluginManager: EditorPluginManager): Promise { - console.log('[PluginInstaller] Installing builtin plugins...'); - const plugins = [ new SceneInspectorPlugin(), new ProfilerPlugin(), @@ -16,12 +14,9 @@ export class PluginInstaller { for (const plugin of plugins) { try { await pluginManager.installEditor(plugin); - console.log(`[PluginInstaller] Installed plugin: ${plugin.name}`); } catch (error) { console.error(`[PluginInstaller] Failed to install plugin ${plugin.name}:`, error); } } - - console.log('[PluginInstaller] All builtin plugins installed'); } } diff --git a/packages/editor-app/src/core/bootstrap/EditorBootstrap.ts b/packages/editor-app/src/core/bootstrap/EditorBootstrap.ts index 85685582..66e2931a 100644 --- a/packages/editor-app/src/core/bootstrap/EditorBootstrap.ts +++ b/packages/editor-app/src/core/bootstrap/EditorBootstrap.ts @@ -23,24 +23,14 @@ export class EditorBootstrap { throw new Error('EditorBootstrap has already been initialized'); } - console.log('[EditorBootstrap] Starting editor initialization...'); const scene = await this.createScene(); - console.log('[EditorBootstrap] Scene created'); - const container = globalContainer; const eventBus = container.resolve(EditorEventBus); - console.log('[EditorBootstrap] EventBus initialized'); - const commands = container.resolve(CommandRegistry); - console.log('[EditorBootstrap] CommandRegistry initialized'); - const panels = container.resolve(PanelRegistry); - console.log('[EditorBootstrap] PanelRegistry initialized'); - this.initialized = true; - console.log('[EditorBootstrap] Editor initialized successfully'); return { container, diff --git a/packages/editor-app/src/plugins/SceneInspectorPlugin.ts b/packages/editor-app/src/plugins/SceneInspectorPlugin.ts index 2bba408d..4f1281df 100644 --- a/packages/editor-app/src/plugins/SceneInspectorPlugin.ts +++ b/packages/editor-app/src/plugins/SceneInspectorPlugin.ts @@ -16,11 +16,9 @@ export class SceneInspectorPlugin implements IEditorPlugin { readonly icon = '🔍'; async install(_core: Core, _services: ServiceContainer): Promise { - console.log('[SceneInspectorPlugin] Installed'); } async uninstall(): Promise { - console.log('[SceneInspectorPlugin] Uninstalled'); } registerMenuItems(): MenuItem[] { @@ -30,7 +28,6 @@ export class SceneInspectorPlugin implements IEditorPlugin { label: 'Scene Inspector', parentId: 'view', onClick: () => { - console.log('Toggle Scene Inspector'); }, shortcut: 'Ctrl+Shift+I', order: 100 @@ -40,7 +37,6 @@ export class SceneInspectorPlugin implements IEditorPlugin { label: 'Create Entity', parentId: 'scene', onClick: () => { - console.log('Create new entity'); }, shortcut: 'Ctrl+N', order: 10 @@ -56,7 +52,6 @@ export class SceneInspectorPlugin implements IEditorPlugin { groupId: 'entity-tools', icon: '➕', onClick: () => { - console.log('Create entity from toolbar'); }, order: 10 }, @@ -66,7 +61,6 @@ export class SceneInspectorPlugin implements IEditorPlugin { groupId: 'entity-tools', icon: '🗑️', onClick: () => { - console.log('Delete entity from toolbar'); }, order: 20 } @@ -117,14 +111,11 @@ export class SceneInspectorPlugin implements IEditorPlugin { } async onEditorReady(): Promise { - console.log('[SceneInspectorPlugin] Editor is ready'); } async onProjectOpen(projectPath: string): Promise { - console.log(`[SceneInspectorPlugin] Project opened: ${projectPath}`); } async onProjectClose(): Promise { - console.log('[SceneInspectorPlugin] Project closed'); } } diff --git a/packages/editor-app/src/services/GitHubService.ts b/packages/editor-app/src/services/GitHubService.ts index b967f42a..525a3d3a 100644 --- a/packages/editor-app/src/services/GitHubService.ts +++ b/packages/editor-app/src/services/GitHubService.ts @@ -280,9 +280,6 @@ export class GitHubService { * 返回设备代码信息,包含用户需要访问的 URL 和输入的代码 */ async requestDeviceCode(): Promise { - console.log('[GitHubService] Requesting device code...'); - console.log('[GitHubService] Client ID:', this.CLIENT_ID); - try { const response = await fetch('https://github.com/login/device/code', { method: 'POST', @@ -296,9 +293,6 @@ export class GitHubService { }) }); - console.log('[GitHubService] Response status:', response.status); - console.log('[GitHubService] Response ok:', response.ok); - if (!response.ok) { const error = await response.text(); console.error('[GitHubService] Request device code failed:', error); @@ -306,11 +300,6 @@ export class GitHubService { } const data = (await response.json()) as DeviceCodeResponse; - console.log('[GitHubService] Device code received:', { - user_code: data.user_code, - verification_uri: data.verification_uri - }); - return data; } catch (error) { console.error('[GitHubService] Error requesting device code:', error); @@ -518,14 +507,12 @@ export class GitHubService { } async deleteFile(owner: string, repo: string, path: string, message: string, branch: string): Promise { - console.log(`[GitHubService] Getting file SHA for: ${owner}/${repo}/${path}?ref=${branch}`); const existing = await this.request(`GET /repos/${owner}/${repo}/contents/${path}?ref=${branch}`); if (!existing || !existing.sha) { throw new Error(`Failed to get file SHA for ${path}`); } - console.log(`[GitHubService] Deleting file with SHA: ${existing.sha}`); await this.request(`DELETE /repos/${owner}/${repo}/contents/${path}`, { message: message, sha: existing.sha, @@ -631,7 +618,6 @@ export class GitHubService { if (deletedDate && pr.merged_at) { const addedDate = new Date(pr.merged_at); if (deletedDate > addedDate) { - console.log(`[GitHubService] Plugin ${pluginName} was deleted after being added, skipping`); continue; } } @@ -922,12 +908,10 @@ export class GitHubService { try { const stored = localStorage.getItem(this.STORAGE_KEY); if (stored) { - console.log('[GitHubService] Loading stored token...'); this.accessToken = stored; this.notifyUserLoadStateChange(true); this.fetchUser() .then((user) => { - console.log('[GitHubService] User loaded from stored token:', user.login); this.user = user; if (this.retryTimer) { clearTimeout(this.retryTimer); @@ -940,19 +924,15 @@ export class GitHubService { const errorMessage = error instanceof Error ? error.message : String(error); if (errorMessage.includes('401') || errorMessage.includes('Unauthorized')) { - console.log('[GitHubService] Token is invalid or expired, removing it'); this.accessToken = null; this.user = null; localStorage.removeItem(this.STORAGE_KEY); this.notifyUserLoadStateChange(false); } else { - console.log('[GitHubService] Temporary error fetching user, will retry in 5 seconds'); this.scheduleRetryLoadUser(); } }); - } else { - console.log('[GitHubService] No stored token found'); - } + } } catch (error) { console.error('[GitHubService] Failed to load token:', error); this.notifyUserLoadStateChange(false); @@ -965,11 +945,9 @@ export class GitHubService { } this.retryTimer = window.setTimeout(() => { - console.log('[GitHubService] Retrying to load user...'); if (this.accessToken && !this.user) { this.fetchUser() .then((user) => { - console.log('[GitHubService] User loaded successfully on retry:', user.login); this.user = user; this.retryTimer = null; this.notifyUserLoadStateChange(false); @@ -978,13 +956,11 @@ export class GitHubService { console.error('[GitHubService] Retry failed:', error); const errorMessage = error instanceof Error ? error.message : String(error); if (errorMessage.includes('401') || errorMessage.includes('Unauthorized')) { - console.log('[GitHubService] Token is invalid, removing it'); this.accessToken = null; this.user = null; localStorage.removeItem(this.STORAGE_KEY); this.notifyUserLoadStateChange(false); } else { - console.log('[GitHubService] Will retry again in 10 seconds'); this.retryTimer = window.setTimeout(() => this.scheduleRetryLoadUser(), 10000); } }); diff --git a/packages/editor-app/src/services/PluginBuildService.ts b/packages/editor-app/src/services/PluginBuildService.ts index ee4c159a..1f0898b1 100644 --- a/packages/editor-app/src/services/PluginBuildService.ts +++ b/packages/editor-app/src/services/PluginBuildService.ts @@ -56,7 +56,6 @@ export class PluginBuildService { pluginFolder }); - console.log('[PluginBuildService] Build completed, zip path:', zipPath); return zipPath; } catch (error) { console.error('[PluginBuildService] Build failed:', error); diff --git a/packages/editor-app/src/services/PluginLoader.ts b/packages/editor-app/src/services/PluginLoader.ts index a332c480..077ab5ae 100644 --- a/packages/editor-app/src/services/PluginLoader.ts +++ b/packages/editor-app/src/services/PluginLoader.ts @@ -31,13 +31,11 @@ export class PluginLoader { try { const exists = await TauriAPI.pathExists(pluginsPath); if (!exists) { - console.log('[PluginLoader] No plugins directory found'); return; } const entries = await TauriAPI.listDirectory(pluginsPath); const pluginDirs = entries.filter((entry) => entry.is_dir && !entry.name.startsWith('.')); - console.log('[PluginLoader] Found plugin directories:', pluginDirs.map((d) => d.name)); for (const entry of pluginDirs) { const pluginPath = `${pluginsPath}/${entry.name}`; @@ -102,13 +100,10 @@ export class PluginLoader { const timestamp = Date.now(); const moduleUrl = `/@user-project/plugins/${pluginDirName}/${entryPoint}?v=${currentVersion}&t=${timestamp}`; - console.log(`[PluginLoader] Loading plugin from: ${moduleUrl} (version: ${currentVersion})`); - // 清除可能存在的旧模块缓存 this.loadedModuleUrls.add(moduleUrl); const module = await import(/* @vite-ignore */ moduleUrl); - console.log('[PluginLoader] Module loaded successfully'); let pluginInstance: IEditorPlugin | null = null; try { @@ -133,7 +128,6 @@ export class PluginLoader { const currentLocale = localeService.getCurrentLocale(); if (pluginInstance.setLocale) { pluginInstance.setLocale(currentLocale); - console.log(`[PluginLoader] Set locale for plugin ${packageJson.name}: ${currentLocale}`); } } catch (error) { console.warn(`[PluginLoader] Failed to set locale for plugin ${packageJson.name}:`, error); @@ -144,12 +138,9 @@ export class PluginLoader { const messageHub = Core.services.resolve(MessageHub); const localeService = Core.services.resolve(LocaleService); messageHub.publish('locale:changed', { locale: localeService.getCurrentLocale() }); - console.log(`[PluginLoader] Published locale:changed event for plugin ${packageJson.name}`); } catch (error) { console.warn('[PluginLoader] Failed to publish locale:changed event:', error); } - - console.log(`[PluginLoader] Successfully loaded plugin: ${packageJson.name}`); } catch (error) { console.error(`[PluginLoader] Failed to load plugin from ${pluginPath}:`, error); if (error instanceof Error) { @@ -159,17 +150,13 @@ export class PluginLoader { } private findPluginInstance(module: any): IEditorPlugin | null { - console.log('[PluginLoader] Module exports:', Object.keys(module)); - if (module.default && this.isPluginInstance(module.default)) { - console.log('[PluginLoader] Found plugin in default export'); return module.default; } for (const key of Object.keys(module)) { const value = module[key]; if (value && this.isPluginInstance(value)) { - console.log(`[PluginLoader] Found plugin in export: ${key}`); return value; } } @@ -192,19 +179,6 @@ export class PluginLoader { typeof obj.install === 'function' && typeof obj.uninstall === 'function'; - if (!hasRequiredProperties) { - console.log('[PluginLoader] Object is not a valid plugin:', { - hasName: typeof obj.name === 'string', - hasVersion: typeof obj.version === 'string', - hasDisplayName: typeof obj.displayName === 'string', - hasCategory: typeof obj.category === 'string', - hasInstall: typeof obj.install === 'function', - hasUninstall: typeof obj.uninstall === 'function', - objectType: typeof obj, - objectConstructor: obj?.constructor?.name - }); - } - return hasRequiredProperties; } catch (error) { console.error('[PluginLoader] Error in isPluginInstance:', error); @@ -213,11 +187,8 @@ export class PluginLoader { } async unloadProjectPlugins(pluginManager: EditorPluginManager): Promise { - console.log('[PluginLoader] Unloading all project plugins...'); - for (const pluginName of this.loadedPluginNames) { try { - console.log(`[PluginLoader] Uninstalling plugin: ${pluginName}`); await pluginManager.uninstallEditor(pluginName); } catch (error) { console.error(`[PluginLoader] Failed to unload plugin ${pluginName}:`, error); @@ -229,22 +200,14 @@ export class PluginLoader { this.loadedPluginNames.clear(); this.loadedModuleUrls.clear(); - - console.log('[PluginLoader] All project plugins unloaded'); } private invalidateModuleCache(): void { try { // 尝试使用Vite HMR API无效化模块 if (import.meta.hot) { - console.log('[PluginLoader] Attempting to invalidate module cache via HMR'); import.meta.hot.invalidate(); } - - // 清除已加载的模块URL记录 - for (const url of this.loadedModuleUrls) { - console.log(`[PluginLoader] Marking module for reload: ${url}`); - } } catch (error) { console.warn('[PluginLoader] Failed to invalidate module cache:', error); } diff --git a/packages/editor-app/src/services/PluginMarketService.ts b/packages/editor-app/src/services/PluginMarketService.ts index 1777d352..a1fdc451 100644 --- a/packages/editor-app/src/services/PluginMarketService.ts +++ b/packages/editor-app/src/services/PluginMarketService.ts @@ -1,6 +1,6 @@ -import type { EditorPluginManager, IEditorPlugin } from '@esengine/editor-core'; -import JSZip from 'jszip'; +import type { EditorPluginManager } from '@esengine/editor-core'; import { fetch } from '@tauri-apps/plugin-http'; +import { invoke } from '@tauri-apps/api/core'; export interface PluginAuthor { name: string; @@ -80,7 +80,6 @@ export class PluginMarketService { setProjectPath(path: string | null): void { this.projectPath = path; - console.log(`[PluginMarketService] Project path set to: ${path}`); } isUsingDirectSource(): boolean { @@ -89,14 +88,12 @@ export class PluginMarketService { setUseDirectSource(useDirect: boolean): void { localStorage.setItem(this.USE_DIRECT_SOURCE_KEY, String(useDirect)); - console.log(`[PluginMarketService] Direct source ${useDirect ? 'enabled' : 'disabled'}`); } async fetchPluginList(bypassCache: boolean = false): Promise { const useDirectSource = this.isUsingDirectSource(); if (useDirectSource) { - console.log('[PluginMarketService] Using direct GitHub source (bypass CDN)'); return await this.fetchFromUrl(this.GITHUB_DIRECT_URL, bypassCache); } @@ -131,16 +128,9 @@ export class PluginMarketService { if (bypassCache) { url += `?t=${Date.now()}`; if (urlIndex && totalUrls) { - console.log(`[PluginMarketService] Bypassing cache with timestamp (URL ${urlIndex}/${totalUrls})`); } } - if (urlIndex && totalUrls) { - console.log(`[PluginMarketService] Trying URL ${urlIndex}/${totalUrls}: ${url}`); - } else { - console.log(`[PluginMarketService] Fetching from: ${url}`); - } - const response = await fetch(url, { cache: 'no-cache', headers: { @@ -154,22 +144,11 @@ export class PluginMarketService { } const registry: PluginRegistry = await response.json(); - - if (urlIndex) { - console.log(`[PluginMarketService] Successfully loaded from URL ${urlIndex}`); - } else { - console.log(`[PluginMarketService] Successfully loaded`); - } - console.log(`[PluginMarketService] Loaded ${registry.plugins.length} plugins from registry`); - console.log(`[PluginMarketService] Registry generated at: ${registry.generatedAt}`); - return registry.plugins; } async installPlugin(plugin: PluginMarketMetadata, version?: string, onReload?: () => Promise): Promise { const targetVersion = version || plugin.latestVersion; - console.log(`[PluginMarketService] Installing plugin: ${plugin.name} v${targetVersion}`); - if (!this.projectPath) { throw new Error('No project opened. Please open a project first.'); } @@ -182,11 +161,9 @@ export class PluginMarketService { } // 下载 ZIP 文件 - console.log(`[PluginMarketService] Downloading ZIP: ${versionInfo.zipUrl}`); const zipBlob = await this.downloadZip(versionInfo.zipUrl); // 解压到项目 plugins 目录 - console.log(`[PluginMarketService] Extracting plugin to project...`); await this.extractZipToProject(zipBlob, plugin.id); // 标记为已安装 @@ -194,11 +171,8 @@ export class PluginMarketService { // 重新加载项目插件 if (onReload) { - console.log(`[PluginMarketService] Reloading project plugins...`); await onReload(); } - - console.log(`[PluginMarketService] Successfully installed: ${plugin.name} v${targetVersion}`); } catch (error) { console.error(`[PluginMarketService] Failed to install plugin ${plugin.name}:`, error); throw error; @@ -206,8 +180,6 @@ export class PluginMarketService { } async uninstallPlugin(pluginId: string, onReload?: () => Promise): Promise { - console.log(`[PluginMarketService] Uninstalling plugin: ${pluginId}`); - if (!this.projectPath) { throw new Error('No project opened'); } @@ -223,19 +195,14 @@ export class PluginMarketService { pluginId: pluginId }); - console.log(`[PluginMarketService] Successfully removed plugin directory`); - // 从已安装列表移除 this.installedPlugins.delete(pluginId); this.saveInstalledPlugins(); // 重新加载项目插件 if (onReload) { - console.log(`[PluginMarketService] Reloading project plugins...`); await onReload(); } - - console.log(`[PluginMarketService] Successfully uninstalled: ${pluginId}`); } catch (error) { console.error(`[PluginMarketService] Failed to uninstall plugin ${pluginId}:`, error); throw error; @@ -286,14 +253,11 @@ export class PluginMarketService { const base64Data = btoa(binary); // 调用 Tauri 后端命令进行安装 - const { invoke } = await import('@tauri-apps/api/core'); - const pluginDir = await invoke('install_marketplace_plugin', { + await invoke('install_marketplace_plugin', { projectPath: this.projectPath, pluginId: pluginId, zipDataBase64: base64Data }); - - console.log(`[PluginMarketService] Successfully extracted plugin to ${pluginDir}`); } catch (error) { console.error('[PluginMarketService] Failed to extract ZIP:', error); throw new Error(`Failed to extract plugin: ${error instanceof Error ? error.message : String(error)}`); diff --git a/packages/editor-app/src/services/PluginPublishService.ts b/packages/editor-app/src/services/PluginPublishService.ts index 46626404..7ac4e6ee 100644 --- a/packages/editor-app/src/services/PluginPublishService.ts +++ b/packages/editor-app/src/services/PluginPublishService.ts @@ -48,7 +48,6 @@ export class PluginPublishService { } private notifyProgress(step: PublishStep, message: string, progress: number): void { - console.log(`[PluginPublishService] ${message} (${progress}%)`); this.progressCallback?.({ step, message, progress }); } @@ -59,9 +58,6 @@ export class PluginPublishService { * @returns Pull Request URL */ async publishPlugin(publishInfo: PluginPublishInfo, zipPath: string): Promise { - console.log('[PluginPublishService] Publishing plugin with ZIP:', zipPath); - console.log('[PluginPublishService] Plugin info:', publishInfo); - if (!this.githubService.isAuthenticated()) { throw new Error('Please login to GitHub first'); } @@ -214,7 +210,6 @@ export class PluginPublishService { ); return JSON.parse(content); } catch (error) { - console.log(`[PluginPublishService] No existing manifest found, will create new one`); return null; } } @@ -543,7 +538,6 @@ ${releaseNotes} throw new Error(`No files found to delete in ${pluginPath}`); } - console.log(`[PluginPublishService] Files to delete:`, filesToDelete.map(f => f.path)); this.notifyProgress('uploading-files', `Deleting ${filesToDelete.length} files...`, 40); let deletedCount = 0; @@ -551,7 +545,6 @@ ${releaseNotes} for (const file of filesToDelete) { try { - console.log(`[PluginPublishService] Deleting file: ${file.path} (SHA: ${file.sha}) from ${user.login}/${this.REGISTRY_REPO}:${branchName}`); await this.githubService.deleteFileWithSha( user.login, this.REGISTRY_REPO, @@ -561,7 +554,6 @@ ${releaseNotes} branchName ); deletedCount++; - console.log(`[PluginPublishService] Successfully deleted: ${file.path}`); const progress = 40 + Math.floor((deletedCount / filesToDelete.length) * 40); this.notifyProgress('uploading-files', `Deleted ${deletedCount}/${filesToDelete.length} files`, progress); } catch (error) { diff --git a/packages/editor-app/src/services/PluginSourceParser.ts b/packages/editor-app/src/services/PluginSourceParser.ts index fd69cacb..b5b71d03 100644 --- a/packages/editor-app/src/services/PluginSourceParser.ts +++ b/packages/editor-app/src/services/PluginSourceParser.ts @@ -47,8 +47,6 @@ export class PluginSourceParser { const packageJsonContent = await readTextFile(packageJsonPath); const packageJson = JSON.parse(packageJsonContent) as PluginPackageJson; - console.log('[PluginSourceParser] Parsed package.json from folder:', packageJson); - return { packageJson, sourceType: 'folder', @@ -87,8 +85,6 @@ export class PluginSourceParser { const packageJsonContent = await packageJsonFile.async('text'); const packageJson = JSON.parse(packageJsonContent) as PluginPackageJson; - console.log('[PluginSourceParser] Parsed package.json from ZIP:', packageJson); - // 验证 ZIP 中必须包含 dist 目录 const distFiles = Object.keys(zip.files).filter(f => f.startsWith('dist/')); if (distFiles.length === 0) { diff --git a/packages/editor-app/src/utils/updater.ts b/packages/editor-app/src/utils/updater.ts index 2fe76542..c52b9226 100644 --- a/packages/editor-app/src/utils/updater.ts +++ b/packages/editor-app/src/utils/updater.ts @@ -18,11 +18,6 @@ export async function checkForUpdates(silent: boolean = false): Promise ({ } const filePath = path.join(projectPath, relativePath); - console.log('[Vite] Loading file:', id); - console.log('[Vite] Resolved path:', filePath); if (!fs.existsSync(filePath)) { throw new Error(`File not found: ${filePath}`); diff --git a/packages/editor-core/src/Plugins/EditorPluginManager.ts b/packages/editor-core/src/Plugins/EditorPluginManager.ts index 216b0ef0..b0bec9da 100644 --- a/packages/editor-core/src/Plugins/EditorPluginManager.ts +++ b/packages/editor-core/src/Plugins/EditorPluginManager.ts @@ -66,12 +66,9 @@ export class EditorPluginManager extends PluginManager { this.pluginMetadata.set(plugin.name, metadata); try { - console.log('[EditorPluginManager] Checking registerMenuItems:', !!plugin.registerMenuItems); if (plugin.registerMenuItems) { const menuItems = plugin.registerMenuItems(); - console.log('[EditorPluginManager] Got menu items:', menuItems); this.uiRegistry.registerMenus(menuItems); - console.log('[EditorPluginManager] Registered menu items to UIRegistry'); logger.debug(`Registered ${menuItems.length} menu items for ${plugin.name}`); } diff --git a/packages/editor-core/src/Services/CompilerRegistry.ts b/packages/editor-core/src/Services/CompilerRegistry.ts index 293d31a2..d095dc5d 100644 --- a/packages/editor-core/src/Services/CompilerRegistry.ts +++ b/packages/editor-core/src/Services/CompilerRegistry.ts @@ -9,12 +9,10 @@ export class CompilerRegistry implements IService { console.warn(`Compiler with id "${compiler.id}" is already registered. Overwriting.`); } this.compilers.set(compiler.id, compiler); - console.log(`[CompilerRegistry] Registered compiler: ${compiler.name} (${compiler.id})`); } unregister(compilerId: string): void { this.compilers.delete(compilerId); - console.log(`[CompilerRegistry] Unregistered compiler: ${compilerId}`); } get(compilerId: string): ICompiler | undefined { diff --git a/packages/editor-core/src/Services/FileActionRegistry.ts b/packages/editor-core/src/Services/FileActionRegistry.ts index 5f6ea4f9..06c7a5d5 100644 --- a/packages/editor-core/src/Services/FileActionRegistry.ts +++ b/packages/editor-core/src/Services/FileActionRegistry.ts @@ -82,18 +82,10 @@ export class FileActionRegistry implements IService { * 处理文件双击 */ async handleDoubleClick(filePath: string): Promise { - const extension = this.getFileExtension(filePath); - console.log('[FileActionRegistry] handleDoubleClick:', filePath); - console.log('[FileActionRegistry] Extension:', extension); - console.log('[FileActionRegistry] Total handlers:', this.actionHandlers.size); - console.log('[FileActionRegistry] Registered extensions:', Array.from(this.actionHandlers.keys())); - const handlers = this.getHandlersForFile(filePath); - console.log('[FileActionRegistry] Found handlers:', handlers.length); for (const handler of handlers) { if (handler.onDoubleClick) { - console.log('[FileActionRegistry] Calling handler for extensions:', handler.extensions); await handler.onDoubleClick(filePath); return true; } diff --git a/packages/editor-core/src/Services/WindowRegistry.ts b/packages/editor-core/src/Services/WindowRegistry.ts index bc569d41..0ec4824a 100644 --- a/packages/editor-core/src/Services/WindowRegistry.ts +++ b/packages/editor-core/src/Services/WindowRegistry.ts @@ -70,7 +70,6 @@ export class WindowRegistry implements IService { return; } this.windows.set(descriptor.id, descriptor); - console.log(`[WindowRegistry] Registered window: ${descriptor.id}`); } /** @@ -106,7 +105,6 @@ export class WindowRegistry implements IService { return; } - console.log(`[WindowRegistry] Opening window: ${windowId}`, params); this.openWindows.set(windowId, { descriptor, isOpen: true, @@ -119,7 +117,6 @@ export class WindowRegistry implements IService { * 关闭窗口 */ closeWindow(windowId: string): void { - console.log(`[WindowRegistry] Closing window: ${windowId}`); this.openWindows.delete(windowId); this.notifyListeners(); }