Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions jetbrains_projects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 []
Expand All @@ -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",
Expand Down Expand Up @@ -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
Expand Down
171 changes: 171 additions & 0 deletions jetbrains_projects/icons/aqua.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions jetbrains_projects/icons/writerside.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.