diff --git a/jetbrains_projects/__init__.py b/jetbrains_projects/__init__.py index 623f8eb1..9d754ef2 100644 --- a/jetbrains_projects/__init__.py +++ b/jetbrains_projects/__init__.py @@ -37,7 +37,7 @@ md_description = "Open your JetBrains projects" md_license = "MIT" md_url = "https://github.com/albertlauncher/python/tree/main/jetbrains_projects" -md_authors = ["@tomsquest", "@vmaerten", "@manuelschneid3r"] +md_authors = ["@tomsquest", "@vmaerten", "@manuelschneid3r", "@d3v2a"] @dataclass @@ -84,15 +84,22 @@ def _parse_recent_projects(self, recent_projects_file: Path) -> list[Project]: projects = [] for entry in entries: - project_path = entry.attrib["key"].replace("$USER_HOME$", str(Path.home())) - + project_path = entry.attrib["key"] + project_path = project_path.replace("$USER_HOME$", str(Path.home())) + project_name = Path(project_path).name + files = Path(project_path + "/.idea").glob("*.iml") tag_opened = entry.find(".//option[@name='projectOpenTimestamp']") last_opened = tag_opened.attrib["value"] if tag_opened is not None and "value" in tag_opened.attrib else None if project_path and last_opened: projects.append( - Project(name=Path(project_path).name, path=project_path, last_opened=int(last_opened)) + Project(name=project_name, path=project_path, last_opened=int(last_opened)) ) + for file in files: + name = file.name.replace(".iml", "") + if name != project_name: + projects.append(Project(name=name, path=project_path, last_opened=int(last_opened))) + return projects except (ElementTree.ParseError, FileNotFoundError): return [] @@ -117,6 +124,11 @@ def __init__(self): config_dir_prefix="Google/AndroidStudio", binaries=["studio", "androidstudio", "android-studio", "android-studio-canary", "jdk-android-studio", "android-studio-system-jdk"]), + Editor( + name="Aqua", + icon=plugin_dir / "icons" / "aqua.svg", + config_dir_prefix="JetBrains/Aqua", + binaries=["aqua", "aqua-eap"]), Editor( name="CLion", icon=plugin_dir / "icons" / "clion.svg", @@ -174,15 +186,21 @@ def __init__(self): icon=plugin_dir / "icons" / "rustrover.svg", config_dir_prefix="JetBrains/RustRover", binaries=["rustrover", "rustrover-eap"]), + Editor( + name="Writerside", + icon=plugin_dir / "icons" / "writerside.svg", + config_dir_prefix="JetBrains/Writerside", + binaries=["writerside", "writerside-eap"]), ] self.editors = [e for e in editors if e.binary is not None] def handleTriggerQuery(self, query: Query): editor_project_pairs = [] + query_lower = query.string.lower() for editor in self.editors: projects = editor.list_projects() projects = [p for p in projects if Path(p.path).exists()] - projects = [p for p in projects if query.string.lower() in p.name.lower()] + projects = [p for p in projects if query_lower in p.name.lower() or query_lower in p.path.lower()] editor_project_pairs.extend([(editor, p) for p in projects]) # sort by last opened diff --git a/jetbrains_projects/icons/aqua.svg b/jetbrains_projects/icons/aqua.svg new file mode 100644 index 00000000..a2d7e161 --- /dev/null +++ b/jetbrains_projects/icons/aqua.svg @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jetbrains_projects/icons/writerside.svg b/jetbrains_projects/icons/writerside.svg new file mode 100644 index 00000000..087eed26 --- /dev/null +++ b/jetbrains_projects/icons/writerside.svg @@ -0,0 +1,9 @@ + + + + + + + + +