From 6b68dce17910b356096a7f0d33a65ba64eb2c0e8 Mon Sep 17 00:00:00 2001 From: SX2000CN Date: Wed, 10 Dec 2025 09:29:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20VS=20Code=20Inside?= =?UTF-8?q?rs=20=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- augment_tools_core/common_utils.py | 28 ++++++++++++++++++++++++++-- config/settings.json | 4 ++-- gui_qt6/main_page.py | 11 +++++++---- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/augment_tools_core/common_utils.py b/augment_tools_core/common_utils.py index 4ebf916..c69e681 100644 --- a/augment_tools_core/common_utils.py +++ b/augment_tools_core/common_utils.py @@ -19,6 +19,7 @@ class IDEType(Enum): """Supported IDE types""" VSCODE = "vscode" + VSCODE_INSIDERS = "vscode_insiders" CURSOR = "cursor" WINDSURF = "windsurf" JETBRAINS = "jetbrains" @@ -88,6 +89,24 @@ def get_ide_paths(ide_type: IDEType) -> Optional[Dict[str, Path]]: paths["state_db"] = base_dir / "globalStorage" / "state.vscdb" paths["storage_json"] = base_dir / "globalStorage" / "storage.json" + elif ide_type == IDEType.VSCODE_INSIDERS: + if system == "Windows": + appdata = os.environ.get("APPDATA") + if not appdata: + print_error("APPDATA environment variable not found. Cannot locate VS Code Insiders data.") + return None + base_dir = Path(appdata) / "Code - Insiders" / "User" + elif system == "Darwin": # macOS + base_dir = Path.home() / "Library" / "Application Support" / "Code - Insiders" / "User" + elif system == "Linux": + base_dir = Path.home() / ".config" / "Code - Insiders" / "User" + else: + print_error(f"Unsupported operating system: {system}") + return None + + paths["state_db"] = base_dir / "globalStorage" / "state.vscdb" + paths["storage_json"] = base_dir / "globalStorage" / "storage.json" + elif ide_type == IDEType.CURSOR: if system == "Windows": appdata = os.environ.get("APPDATA") @@ -261,6 +280,7 @@ def get_ide_display_name(ide_type: IDEType) -> str: """Get display name for IDE type""" display_names = { IDEType.VSCODE: "VS Code", + IDEType.VSCODE_INSIDERS: "VS Code Insiders", IDEType.CURSOR: "Cursor", IDEType.WINDSURF: "Windsurf", IDEType.JETBRAINS: "JetBrains" @@ -270,7 +290,8 @@ def get_ide_display_name(ide_type: IDEType) -> str: def get_ide_process_names(ide_type: IDEType) -> list: """Get process names for the specified IDE""" process_names = { - IDEType.VSCODE: ["Code.exe", "Code - Insiders.exe", "Code - OSS.exe"], + IDEType.VSCODE: ["Code.exe", "Code - OSS.exe"], + IDEType.VSCODE_INSIDERS: ["Code - Insiders.exe"], IDEType.CURSOR: ["Cursor.exe", "cursor.exe"], IDEType.WINDSURF: ["Windsurf.exe", "windsurf.exe"], IDEType.JETBRAINS: [ @@ -505,7 +526,8 @@ def get_ide_process_names(ide_type: IDEType) -> list[str]: list[str]: 进程名称列表 """ process_names = { - IDEType.VSCODE: ['Code.exe', 'Code - Insiders.exe', 'Code - OSS.exe'], + IDEType.VSCODE: ['Code.exe', 'Code - OSS.exe'], + IDEType.VSCODE_INSIDERS: ['Code - Insiders.exe'], IDEType.CURSOR: ['Cursor.exe', 'cursor.exe'], IDEType.WINDSURF: ['Windsurf.exe', 'windsurf.exe'], IDEType.JETBRAINS: [ @@ -521,6 +543,7 @@ def get_ide_extension_name(ide_type: IDEType) -> str: """Get the extension name pattern for the specified IDE""" extension_names = { IDEType.VSCODE: "augment.vscode-augment", + IDEType.VSCODE_INSIDERS: "augment.vscode-augment", IDEType.CURSOR: "augment.cursor-augment", IDEType.WINDSURF: "augment.windsurf-augment", IDEType.JETBRAINS: "augment.jetbrains-augment" @@ -532,6 +555,7 @@ def get_patch_target_description(ide_type: IDEType) -> str: """Get description of what will be patched for the IDE""" descriptions = { IDEType.VSCODE: "VS Code AugmentCode 扩展文件", + IDEType.VSCODE_INSIDERS: "VS Code Insiders AugmentCode 扩展文件", IDEType.CURSOR: "Cursor AugmentCode 扩展文件", IDEType.WINDSURF: "Windsurf AugmentCode 扩展文件", IDEType.JETBRAINS: "JetBrains AugmentCode 插件文件" diff --git a/config/settings.json b/config/settings.json index d0df1b0..9a06e8b 100644 --- a/config/settings.json +++ b/config/settings.json @@ -1,8 +1,8 @@ { - "language": "en_US", + "language": "zh_CN", "first_run": false, "window_geometry": "680x780", - "last_selected_ide": "Windsurf", + "last_selected_ide": "VS Code Insiders", "show_welcome": false, "show_about_on_startup": true, "theme": "default" diff --git a/gui_qt6/main_page.py b/gui_qt6/main_page.py index df081c5..f3c01f9 100644 --- a/gui_qt6/main_page.py +++ b/gui_qt6/main_page.py @@ -140,13 +140,13 @@ def _create_ide_section(self, parent_layout): # IDE下拉框 - 适当调整宽度 self.ide_combo = QComboBox() self.ide_combo.setFont(get_default_font(10)) - self.ide_combo.addItems(["VS Code", "Cursor", "Windsurf", "JetBrains"]) - self.ide_combo.setMaximumWidth(160) # 稍微增加宽度 - self.ide_combo.setMinimumWidth(140) + self.ide_combo.addItems(["VS Code", "VS Code Insiders", "Cursor", "Windsurf", "JetBrains"]) + self.ide_combo.setMaximumWidth(180) # 增加宽度以适应更长的选项 + self.ide_combo.setMinimumWidth(160) # 设置上次选择的IDE last_ide = self.config_manager.get_last_selected_ide() - if last_ide in ["VS Code", "Cursor", "Windsurf", "JetBrains"]: + if last_ide in ["VS Code", "VS Code Insiders", "Cursor", "Windsurf", "JetBrains"]: self.ide_combo.setCurrentText(last_ide) ide_layout.addWidget(self.ide_combo) @@ -453,6 +453,8 @@ def get_selected_ide_type(self) -> IDEType: ide_name = self.ide_combo.currentText() if ide_name == "VS Code": return IDEType.VSCODE + elif ide_name == "VS Code Insiders": + return IDEType.VSCODE_INSIDERS elif ide_name == "Cursor": return IDEType.CURSOR elif ide_name == "Windsurf": @@ -629,6 +631,7 @@ def _get_selected_ide_type(self) -> IDEType: ide_text = self.ide_combo.currentText() ide_mapping = { "VS Code": IDEType.VSCODE, + "VS Code Insiders": IDEType.VSCODE_INSIDERS, "Cursor": IDEType.CURSOR, "Windsurf": IDEType.WINDSURF, "JetBrains": IDEType.JETBRAINS