Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Developer lists what an editor kept for a project that is gone

Țugui Dragoșe0658b9d7799
diff --git a/Localization/Peel/Localizable.xcstrings b/Localization/Peel/Localizable.xcstrings
index 8eb9f658..e887f7e1 100644
--- a/Localization/Peel/Localizable.xcstrings
+++ b/Localization/Peel/Localizable.xcstrings
@@ -10337,6 +10337,112 @@
}
}
},
+ "An editor’s state for a project that is gone, its chat history included" : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Stav editoru pro již neexistující projekt, včetně historie chatu"
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Editorzustand eines nicht mehr vorhandenen Projekts, samt Chatverlauf"
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Estado de un editor para un proyecto que ya no está, incluido su historial de chat"
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "État d’un éditeur pour un projet disparu, historique des conversations compris"
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Stato di un editor per un progetto che non c’è più, cronologia della chat inclusa"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "すでになくなったプロジェクトのエディタの状態(チャット履歴を含む)"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "사라진 프로젝트의 편집기 상태, 채팅 기록 포함"
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Editorstatus voor een project dat er niet meer is, inclusief de chatgeschiedenis"
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Stan edytora dla nieistniejącego już projektu, wraz z historią czatu"
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Estado de um editor para um projeto que não existe mais, incluindo o histórico de conversas"
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Starea unui editor pentru un proiect care nu mai există, cu tot cu istoricul conversațiilor"
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Состояние редактора для проекта, которого больше нет, включая историю чата"
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "En kodredigerares tillstånd för ett projekt som är borta, chatthistoriken inräknad"
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Artık var olmayan bir proje için bir düzenleyicinin durumu, sohbet geçmişi dahil"
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Стан редактора для проєкту, якого вже немає, разом з історією чату"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "已不存在的项目的编辑器状态,包括其聊天记录"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "已不存在之計畫案的編輯器狀態,包括其聊天記錄"
+ }
+ }
+ }
+ },
"And ^[%lld more file](inflect: true). Package Receipts lists them all." : {
"localizations" : {
"cs" : {
@@ -13465,108 +13571,108 @@
}
}
},
- "Archives, symbols from your devices, model weights, installed environments, downloads kept to install again, the build data of a project opened in the last week, folders nothing shows the tool made, and anything Peel couldn’t measure are listed but never selected for you." : {
+ "Archives, symbols from your devices, model weights, installed environments, downloads kept to install again, the build data of a project opened in the last week, an editor’s state for a project that is gone, folders nothing shows the tool made, and anything Peel couldn’t measure are listed but never selected for you." : {
"localizations" : {
"cs" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Archivy, symboly z vašich zařízení, váhy modelů, nainstalovaná prostředí, stažené soubory uchované pro opětovnou instalaci, data sestavení projektu otevřeného během posledního týdne, složky, u kterých nic nenasvědčuje, že je nástroj vytvořil, a vše, co Peel nedokázal změřit, jsou v seznamu, ale Peel je za vás nikdy nevybere."
+ "value" : "Archivy, symboly z vašich zařízení, váhy modelů, nainstalovaná prostředí, stažené soubory uchované pro opětovnou instalaci, data sestavení projektu otevřeného během posledního týdne, stav editoru pro již neexistující projekt, složky, u kterých nic nenasvědčuje, že je nástroj vytvořil, a vše, co Peel nedokázal změřit, jsou v seznamu, ale Peel je za vás nikdy nevybere."
}
},
"de" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Archive, Debug-Symbole von deinen Geräten, Modellgewichte, installierte Umgebungen, aufbewahrte Downloads zum erneuten Installieren, die Build-Daten eines in der letzten Woche geöffneten Projekts, Ordner ohne Hinweis darauf, dass das Tool sie erstellt hat, und alles, was Peel nicht messen konnte, werden angezeigt, aber nie für dich ausgewählt."
+ "value" : "Archive, Debug-Symbole von deinen Geräten, Modellgewichte, installierte Umgebungen, aufbewahrte Downloads zum erneuten Installieren, die Build-Daten eines in der letzten Woche geöffneten Projekts, der Editorzustand eines nicht mehr vorhandenen Projekts, Ordner ohne Hinweis darauf, dass das Tool sie erstellt hat, und alles, was Peel nicht messen konnte, werden angezeigt, aber nie für dich ausgewählt."
}
},
"es" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Las copias archivadas, los símbolos de tus dispositivos, los pesos de modelos, los entornos instalados, las descargas que se conservan para volver a instalarlas, los datos de compilación de un proyecto abierto en la última semana, las carpetas que nada indica que haya creado la herramienta y todo lo que Peel no ha podido medir se muestran, pero nunca se seleccionan por ti."
+ "value" : "Las copias archivadas, los símbolos de tus dispositivos, los pesos de modelos, los entornos instalados, las descargas que se conservan para volver a instalarlas, los datos de compilación de un proyecto abierto en la última semana, el estado de un editor para un proyecto que ya no está, las carpetas que nada indica que haya creado la herramienta y todo lo que Peel no ha podido medir se muestran, pero nunca se seleccionan por ti."
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Les archives, les symboles de débogage provenant de vos appareils, les poids de modèles, les environnements installés, les téléchargements conservés pour être réinstallés, les données de compilation d’un projet ouvert au cours de la dernière semaine, les dossiers que rien ne rattache à l’outil et tout ce que Peel n’a pas pu mesurer sont listés, mais jamais sélectionnés à votre place."
+ "value" : "Les archives, les symboles de débogage provenant de vos appareils, les poids de modèles, les environnements installés, les téléchargements conservés pour être réinstallés, les données de compilation d’un projet ouvert au cours de la dernière semaine, l’état d’un éditeur pour un projet disparu, les dossiers que rien ne rattache à l’outil et tout ce que Peel n’a pas pu mesurer sont listés, mais jamais sélectionnés à votre place."
}
},
"it" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Archivi, simboli dai tuoi dispositivi, pesi dei modelli, ambienti installati, download conservati per reinstallarli, dati di build di un progetto aperto nell’ultima settimana, cartelle per cui nulla indica che le abbia create lo strumento e tutto ciò che Peel non è riuscito a misurare sono elencati, ma non vengono mai selezionati al posto tuo."
+ "value" : "Archivi, simboli dai tuoi dispositivi, pesi dei modelli, ambienti installati, download conservati per reinstallarli, dati di build di un progetto aperto nell’ultima settimana, stato di un editor per un progetto che non c’è più, cartelle per cui nulla indica che le abbia create lo strumento e tutto ciò che Peel non è riuscito a misurare sono elencati, ma non vengono mai selezionati al posto tuo."
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "アーカイブ、デバイスから取り込んだシンボル、モデルの重み、インストール済みの環境、再インストール用に保管されているダウンロード、過去1週間以内に開かれたプロジェクトのビルドデータ、ツールが作成したことを示すものがないフォルダ、Peelが計測できなかったものは、一覧には表示されますが、自動で選択されることはありません。"
+ "value" : "アーカイブ、デバイスから取り込んだシンボル、モデルの重み、インストール済みの環境、再インストール用に保管されているダウンロード、過去1週間以内に開かれたプロジェクトのビルドデータ、すでになくなったプロジェクトのエディタの状態、ツールが作成したことを示すものがないフォルダ、Peelが計測できなかったものは、一覧には表示されますが、自動で選択されることはありません。"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "아카이브, 기기에서 가져온 심볼, 모델 가중치, 설치된 환경, 다시 설치할 수 있도록 보관된 다운로드 파일, 최근 일주일 이내에 연 프로젝트의 빌드 데이터, 도구가 만들었음을 보여 주는 항목이 없는 폴더 및 Peel이 측정할 수 없었던 모든 항목은 목록에 표시되지만 절대 미리 선택되지 않습니다."
+ "value" : "아카이브, 기기에서 가져온 심볼, 모델 가중치, 설치된 환경, 다시 설치할 수 있도록 보관된 다운로드 파일, 최근 일주일 이내에 연 프로젝트의 빌드 데이터, 사라진 프로젝트의 편집기 상태, 도구가 만들었음을 보여 주는 항목이 없는 폴더 및 Peel이 측정할 수 없었던 모든 항목은 목록에 표시되지만 절대 미리 선택되지 않습니다."
}
},
"nl" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Archieven, foutopsporingssymbolen van je apparaten, modelgewichten, geïnstalleerde omgevingen, bewaarde downloads om opnieuw te installeren, de buildgegevens van een project dat de afgelopen week is geopend, mappen waarvan niets erop wijst dat de tool ze heeft gemaakt en alles wat Peel niet kon meten, worden getoond maar nooit voor je geselecteerd."
+ "value" : "Archieven, foutopsporingssymbolen van je apparaten, modelgewichten, geïnstalleerde omgevingen, bewaarde downloads om opnieuw te installeren, de buildgegevens van een project dat de afgelopen week is geopend, de editorstatus voor een project dat er niet meer is, mappen waarvan niets erop wijst dat de tool ze heeft gemaakt en alles wat Peel niet kon meten, worden getoond maar nooit voor je geselecteerd."
}
},
"pl" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Archiwa, symbole z Twoich urządzeń, wagi modeli, zainstalowane środowiska, pobrane pliki zachowane do ponownej instalacji, dane kompilacji projektu otwartego w ciągu ostatniego tygodnia, foldery, których nic nie łączy z tym narzędziem, i wszystko, czego Peel nie mógł zmierzyć, są na liście, ale nigdy nie są zaznaczane za Ciebie."
+ "value" : "Archiwa, symbole z Twoich urządzeń, wagi modeli, zainstalowane środowiska, pobrane pliki zachowane do ponownej instalacji, dane kompilacji projektu otwartego w ciągu ostatniego tygodnia, stan edytora dla nieistniejącego już projektu, foldery, których nic nie łączy z tym narzędziem, i wszystko, czego Peel nie mógł zmierzyć, są na liście, ale nigdy nie są zaznaczane za Ciebie."
}
},
"pt" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Arquivos comprimidos, símbolos dos seus dispositivos, pesos de modelos, ambientes instalados, downloads guardados para instalar de novo, os dados de compilação de um projeto aberto na última semana, pastas que nada indica terem sido criadas pela ferramenta e tudo o que o Peel não conseguiu medir aparecem na lista, mas o Peel nunca os seleciona por você."
+ "value" : "Arquivos comprimidos, símbolos dos seus dispositivos, pesos de modelos, ambientes instalados, downloads guardados para instalar de novo, os dados de compilação de um projeto aberto na última semana, o estado de um editor para um projeto que não existe mais, pastas que nada indica terem sido criadas pela ferramenta e tudo o que o Peel não conseguiu medir aparecem na lista, mas o Peel nunca os seleciona por você."
}
},
"ro" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Arhivele, simbolurile de pe dispozitivele dvs., ponderile modelelor, mediile instalate, descărcările păstrate pentru a fi instalate din nou, datele de compilare ale unui proiect deschis în ultima săptămână, dosarele despre care nimic nu arată că au fost create de instrument și tot ce Peel nu a putut măsura sunt listate, dar nu sunt niciodată selectate pentru dvs."
+ "value" : "Arhivele, simbolurile de pe dispozitivele dvs., ponderile modelelor, mediile instalate, descărcările păstrate pentru a fi instalate din nou, datele de compilare ale unui proiect deschis în ultima săptămână, starea unui editor pentru un proiect care nu mai există, dosarele despre care nimic nu arată că au fost create de instrument și tot ce Peel nu a putut măsura sunt listate, dar nu sunt niciodată selectate pentru dvs."
}
},
"ru" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Архивы, символы с Ваших устройств, веса моделей, установленные окружения, загрузки, которые хранятся для повторной установки, данные сборки проектов, открывавшихся за последнюю неделю, папки без признаков того, что их создал этот инструмент, и все, что Peel не смог измерить, показываются в списке, но никогда не выбираются за Вас."
+ "value" : "Архивы, символы с Ваших устройств, веса моделей, установленные окружения, загрузки, которые хранятся для повторной установки, данные сборки проектов, открывавшихся за последнюю неделю, состояние редактора для проектов, которых больше нет, папки без признаков того, что их создал этот инструмент, и все, что Peel не смог измерить, показываются в списке, но никогда не выбираются за Вас."
}
},
"sv" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Arkiv, symboler från dina enheter, modellvikter, installerade miljöer, hämtningar som sparas för att installeras igen, byggdata för ett projekt som öppnats under den senaste veckan, mappar som inget visar att verktyget skapat och allt som Peel inte kunde mäta listas men markeras aldrig åt dig."
+ "value" : "Arkiv, symboler från dina enheter, modellvikter, installerade miljöer, hämtningar som sparas för att installeras igen, byggdata för ett projekt som öppnats under den senaste veckan, en kodredigerares tillstånd för ett projekt som är borta, mappar som inget visar att verktyget skapat och allt som Peel inte kunde mäta listas men markeras aldrig åt dig."
}
},
"tr" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Arşivler, aygıtlarınızdan alınan semboller, model ağırlıkları, yüklü ortamlar, yeniden yüklemek için saklanan indirmeler, son bir hafta içinde açılan bir projenin derleme verileri, aracın oluşturduğunu hiçbir şeyin göstermediği klasörler ve Peel’in ölçemediği her şey listelenir ama hiçbir zaman sizin yerinize seçilmez."
+ "value" : "Arşivler, aygıtlarınızdan alınan semboller, model ağırlıkları, yüklü ortamlar, yeniden yüklemek için saklanan indirmeler, son bir hafta içinde açılan bir projenin derleme verileri, artık var olmayan bir proje için bir düzenleyicinin durumu, aracın oluşturduğunu hiçbir şeyin göstermediği klasörler ve Peel’in ölçemediği her şey listelenir ama hiçbir zaman sizin yerinize seçilmez."
}
},
"uk" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Архіви, символи налагодження з ваших пристроїв, ваги моделей, інстальовані середовища, викачані файли, збережені для повторного інсталювання, дані збірки проєктів, відкритих за останній тиждень, папки, щодо яких ніщо не вказує, що їх створив інструмент, і все, що Peel не змогла виміряти, є в списку, але Peel ніколи не вибирає їх за вас."
+ "value" : "Архіви, символи налагодження з ваших пристроїв, ваги моделей, інстальовані середовища, викачані файли, збережені для повторного інсталювання, дані збірки проєктів, відкритих за останній тиждень, стан редактора для проєктів, яких уже немає, папки, щодо яких ніщо не вказує, що їх створив інструмент, і все, що Peel не змогла виміряти, є в списку, але Peel ніколи не вибирає їх за вас."
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "归档、来自你设备的符号、模型权重、已安装的环境、为重新安装而保留的下载文件、过去一周内打开过的项目的构建数据、没有迹象表明由该工具生成的文件夹,以及Peel无法测量的任何内容都会列出,但绝不会替你选择。"
+ "value" : "归档、来自你设备的符号、模型权重、已安装的环境、为重新安装而保留的下载文件、过去一周内打开过的项目的构建数据、已不存在的项目的编辑器状态、没有迹象表明由该工具生成的文件夹,以及Peel无法测量的任何内容都会列出,但绝不会替你选择。"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
- "value" : "封存檔、來自你裝置的符號、模型權重、已安裝的環境、保留供重新安裝的下載檔案、過去一週內打開過的計畫案建置資料、沒有跡象顯示由該工具產生的檔案夾,以及Peel無法測量的任何項目都會列出,但絕不會替你選取。"
+ "value" : "封存檔、來自你裝置的符號、模型權重、已安裝的環境、保留供重新安裝的下載檔案、過去一週內打開過的計畫案建置資料、已不存在之計畫案的編輯器狀態、沒有跡象顯示由該工具產生的檔案夾,以及Peel無法測量的任何項目都會列出,但絕不會替你選取。"
}
}
}
@@ -50625,6 +50731,112 @@
}
}
},
+ "Kept for %@, a project no longer on this Mac" : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Uchováno pro projekt %@, který už v tomto Macu není"
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Aufbewahrt für %@, ein Projekt, das nicht mehr auf diesem Mac ist"
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Se conserva para %@, un proyecto que ya no está en este Mac"
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Conservé pour %@, un projet qui n’est plus sur ce Mac"
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Conservato per %@, un progetto non più presente su questo Mac"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "このMacにはもうないプロジェクト%@のために保管"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "이 Mac에 더 이상 없는 프로젝트인 ‘%@’을(를) 위해 보관됨"
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Bewaard voor %@, een project dat niet meer op deze Mac staat"
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Zachowany dla projektu %@, którego nie ma już na tym Macu"
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Guardado para %@, um projeto que não está mais neste Mac"
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Păstrată pentru %@, un proiect care nu mai este pe acest Mac"
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Хранится для проекта «%@», которого больше нет на этом Mac"
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Sparas för %@, ett projekt som inte längre finns på den här datorn"
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Artık bu Mac’te olmayan %@ projesi için saklanır"
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Збережено для «%@», проєкту, якого вже немає на цьому Mac"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "为%@保留,该项目已不在这台Mac上"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "為「%@」保留,此計畫案已不在這部Mac上"
+ }
+ }
+ }
+ },
"Kind" : {
"localizations" : {
"cs" : {
diff --git a/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swift b/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swift
index d99e350c..661d5a6c 100644
--- a/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swift
+++ b/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swift
@@ -359,6 +359,7 @@ extension DeveloperEnvironment.ContentKind {
case .models: "models, kept by default"
case .environments: "installed packages, kept by default"
case .keptDownloads: "downloads to install again, kept by default"
+ case .projectState: "an editor's state for a project that is gone, kept by default"
}
}
}
diff --git a/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift b/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
index e2d5ee44..1c325b7b 100644
--- a/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
@@ -20,6 +20,9 @@ public struct DeveloperEnvironment: Sendable, Hashable, Identifiable {
case environments
/// What a tool keeps for the person to install again: installers, store packages, virtual machine boxes.
case keptDownloads
+ /// What an editor kept for a project that is no longer on this Mac, its chat history included. Nothing makes
+ /// it again.
+ case projectState
}
/// What an Xcode archive's own `Info.plist` says of the app inside it.
@@ -58,6 +61,8 @@ public struct DeveloperEnvironment: Sendable, Hashable, Identifiable {
public var couldNotBeRead = false
public var archive: Archive?
public var workspace: Workspace?
+ /// The name of the project an editor kept this for, which is no longer on this Mac.
+ public var project: String?
/// False for a folder among the tool's own that nothing shows the tool made. It is listed and never selected.
public var isTheTools = true
@@ -69,7 +74,7 @@ public struct DeveloperEnvironment: Sendable, Hashable, Identifiable {
guard isTheTools, workspace?.mayStillBeInUse != true else { return false }
return switch kind {
case .buildData, .downloads, .cache, .logs: size != nil
- case .deviceSupport, .archives, .models, .environments, .keptDownloads: false
+ case .deviceSupport, .archives, .models, .environments, .keptDownloads, .projectState: false
}
}
}
@@ -130,6 +135,8 @@ public enum DeveloperCaches {
let rowEnding: String?
/// True for Xcode's DerivedData, whose rows are the tool's own only when `derivedDataRow(at:)` shows it.
let rowsAreDerivedData: Bool
+ /// True for an editor's `workspaceStorage`, whose rows are listed only when `goneProject(at:)` names one.
+ let rowsAreProjectState: Bool
/// The Xcode setting that moves the folder elsewhere when it holds an absolute path. The folder is looked
/// for there as well as at `path`, where an earlier Xcode may have left it.
let movedByXcodeSetting: String?
@@ -141,7 +148,8 @@ public enum DeveloperCaches {
init(
_ path: String, _ kind: DeveloperEnvironment.ContentKind, source: String, storeInside: String? = nil,
rowsDepth: Int = 0, rowEnding: String? = nil, rowsAreDerivedData: Bool = false,
- movedByXcodeSetting: String? = nil, base: Base = .home, launchers: [String] = []
+ rowsAreProjectState: Bool = false, movedByXcodeSetting: String? = nil, base: Base = .home,
+ launchers: [String] = []
) {
self.path = path
self.kind = kind
@@ -150,6 +158,7 @@ public enum DeveloperCaches {
self.rowsDepth = rowsDepth
self.rowEnding = rowEnding
self.rowsAreDerivedData = rowsAreDerivedData
+ self.rowsAreProjectState = rowsAreProjectState
self.movedByXcodeSetting = movedByXcodeSetting
self.base = base
self.launchers = launchers
@@ -246,6 +255,20 @@ public enum DeveloperCaches {
return (DeveloperEnvironment.Workspace(name: name, lastUsed: info["LastAccessedDate"] as? Date), true)
}
+ /// The name of the project whose state VS Code, or an editor built on it, keeps at `url`, when that project is
+ /// gone: the `workspace.json` it writes names its folder or workspace file, which is missing from a folder that
+ /// is still there. A project on a disk that is not connected, or on another machine, is not known to be gone.
+ static func goneProject(at url: URL) -> String? {
+ guard
+ let data = BoundedRead.data(at: url.appending(path: "workspace.json"), maximum: 64 * 1_024),
+ let meta = try? JSONSerialization.jsonObject(with: data) as? [String: Any],
+ let written = meta["folder"] as? String ?? meta["workspace"] as? String,
+ let project = URL(string: written), project.isFileURL,
+ project.isMissing, !project.deletingLastPathComponent().isMissing
+ else { return nil }
+ return meta["folder"] != nil ? project.lastPathComponent : project.deletingPathExtension().lastPathComponent
+ }
+
static func archive(at url: URL) -> DeveloperEnvironment.Archive? {
guard
let facts = BoundedRead.propertyList(at: url.appending(path: "Info.plist")),
@@ -667,6 +690,10 @@ public enum DeveloperCaches {
Folder("Library/Application Support/Code/DawnGraphiteCache", .cache, source: "https://github.com/chromium/chromium/blob/main/gpu/ipc/common/gpu_disk_cache_type.cc#L50"),
Folder("Library/Application Support/Code/CachedProfilesData", .cache, source: "https://github.com/microsoft/vscode/blob/main/src/vs/platform/userDataProfile/common/userDataProfile.ts#L274"),
Folder("Library/Application Support/Code/CachedConfigurations", .cache, source: "https://github.com/microsoft/vscode/blob/main/src/vs/workbench/services/configuration/common/configurationCache.ts#L66"),
+ Folder(
+ "Library/Application Support/Code/User/workspaceStorage", .projectState, source: "https://github.com/microsoft/vscode/blob/main/src/vs/platform/storage/electron-main/storageMain.ts#L469-L482",
+ rowsDepth: 1, rowsAreProjectState: true
+ ),
Folder("Library/Caches/com.microsoft.VSCode.ShipIt", .downloads, source: "https://github.com/Squirrel/Squirrel.Mac/blob/main/Squirrel/SQRLUpdater.m#L814-L829"),
]),
Definition(id: "vscodium", name: "VSCodium", systemImage: "curlybraces", appBundleIdentifiers: ["com.vscodium"], folders: [
@@ -681,6 +708,10 @@ public enum DeveloperCaches {
Folder("Library/Application Support/VSCodium/DawnGraphiteCache", .cache, source: "https://github.com/chromium/chromium/blob/main/gpu/ipc/common/gpu_disk_cache_type.cc#L50"),
Folder("Library/Application Support/VSCodium/CachedProfilesData", .cache, source: "https://github.com/microsoft/vscode/blob/main/src/vs/platform/userDataProfile/common/userDataProfile.ts#L274"),
Folder("Library/Application Support/VSCodium/CachedConfigurations", .cache, source: "https://github.com/microsoft/vscode/blob/main/src/vs/workbench/services/configuration/common/configurationCache.ts#L66"),
+ Folder(
+ "Library/Application Support/VSCodium/User/workspaceStorage", .projectState, source: "https://github.com/microsoft/vscode/blob/main/src/vs/platform/storage/electron-main/storageMain.ts#L469-L482",
+ rowsDepth: 1, rowsAreProjectState: true
+ ),
Folder("Library/Caches/com.vscodium.ShipIt", .downloads, source: "https://github.com/Squirrel/Squirrel.Mac/blob/main/Squirrel/SQRLShipItLauncher.m#L25-L26"),
]),
Definition(id: "cursor", name: "Cursor", systemImage: "curlybraces", appBundleIdentifiers: ["com.todesktop.230313mzl4w4u92"], folders: [
@@ -694,6 +725,10 @@ public enum DeveloperCaches {
Folder("Library/Application Support/Cursor/CachedExtensionVSIXs", .downloads, source: "https://github.com/microsoft/vscode/blob/main/src/vs/platform/environment/common/environmentService.ts#L127"),
Folder("Library/Application Support/Cursor/CachedProfilesData", .cache, source: "https://github.com/microsoft/vscode/blob/main/src/vs/platform/userDataProfile/common/userDataProfile.ts#L274"),
Folder("Library/Application Support/Cursor/CachedConfigurations", .cache, source: "https://github.com/microsoft/vscode/blob/main/src/vs/workbench/services/configuration/common/configurationCache.ts#L66"),
+ Folder(
+ "Library/Application Support/Cursor/User/workspaceStorage", .projectState, source: "https://github.com/microsoft/vscode/blob/main/src/vs/platform/storage/electron-main/storageMain.ts#L469-L482",
+ rowsDepth: 1, rowsAreProjectState: true
+ ),
]),
Definition(id: "windsurf", name: "Windsurf & Devin", systemImage: "curlybraces", appBundleIdentifiers: ["com.exafunction.windsurf", "ai.cognition.devin"], folders: [
Folder("Library/Application Support/Devin/Cache", .cache, source: "https://docs.devin.ai/desktop/cascade/workflows"),
@@ -1038,7 +1073,7 @@ public enum DeveloperCaches {
await withTaskGroup(of: DeveloperEnvironment?.self) { group in
for definition in definitions {
_ = group.addTaskUnlessCancelled {
- var found: [(url: URL, folder: Folder)] = []
+ var found: [(url: URL, folder: Folder, project: String?)] = []
for folder in definition.folders {
let places = folder.places(
home: homeDirectory, userCache: userCacheDirectory, preference: preference
@@ -1049,20 +1084,22 @@ public enum DeveloperCaches {
}
for url in rows {
guard !exclusions.excludes(url), !exclusions.holds(url) else { continue }
+ let project = folder.rowsAreProjectState ? Self.goneProject(at: url) : nil
+ guard !folder.rowsAreProjectState || project != nil else { continue }
// Skips a folder that holds work kept nowhere else, such as the state Deno's
// scripts keep in `location_data`. Removing it would lose that work.
guard !ProtectedData.holdsWorkKeptInACache(url.path(percentEncoded: false)) else { continue }
// Skips a symbolic link, which is how people move a big cache to another disk.
// Moving the link frees nothing.
guard (try? url.resourceValues(forKeys: [.isSymbolicLinkKey]).isSymbolicLink) != true else { continue }
- found.append((url, folder))
+ found.append((url, folder, project))
}
}
// A pattern can reach inside a folder another pattern lists, as `*/GPUCache` reaches
// `GPUPersistentCache/GPUCache`, and that folder goes with the one around it.
let paths = found.map { PathPattern.comparablePath(of: $0.url) }
var locations: [DeveloperEnvironment.Location] = []
- for (url, folder) in found {
+ for (url, folder, project) in found {
guard !Task.isCancelled else { return nil }
let path = PathPattern.comparablePath(of: url)
guard !paths.contains(where: { PathComponents.isPath(path, inside: $0) }) else { continue }
@@ -1078,6 +1115,7 @@ public enum DeveloperCaches {
couldNotBeRead: contents?.couldNotBeRead == true,
archive: folder.kind == .archives ? Self.archive(at: url) : nil,
workspace: derived?.workspace,
+ project: project,
isTheTools: derived?.isXcodes ?? true
))
}
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift
index af024e9c..9cb794cd 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift
@@ -391,6 +391,11 @@ struct DeveloperCachesTests {
}
let row = entry + (0..<folder.rowsDepth).map { "/row \($0)" }.joined() + (folder.rowEnding ?? "")
try directory.file("\(row)/content", bytes: 400_000)
+ // An editor's state is listed only for a project that is gone.
+ if folder.rowsAreProjectState {
+ let gone = directory.url.appending(path: "gone-\(definition.id)").absoluteString
+ try directory.file("\(row)/workspace.json", contents: Data(#"{"folder": "\#(gone)"}"#.utf8))
+ }
expected.insert(row)
try directory.file("\(entry)/../elsewhere-\(definition.id)" + (foldersOnly ? "" : "/content"), bytes: 400_000)
}
@@ -981,6 +986,33 @@ struct DeveloperCachesTests {
/// virtualenvwrapper keeps the user's hook scripts beside the environments in `~/.virtualenvs`, so only the
/// environments are offered, and a link among them is left where it is, never followed.
+ /// VS Code writes `workspace.json` in each folder of `workspaceStorage`, naming the folder or workspace file it
+ /// was made for. One whose project is gone from a folder that is still there is listed, never selected, since it
+ /// keeps that project's chat history. A project on a disk that is not connected, or on another machine, is not
+ /// known to be gone.
+ @Test func listsTheStateAnEditorKeptForAProjectThatIsGoneWithoutSelectingIt() async throws {
+ let directory = try TemporaryDirectory()
+ let storage = "Library/Application Support/Code/User/workspaceStorage"
+ let projects = directory.url.appending(path: "Projects", directoryHint: .isDirectory)
+ try directory.directory("Projects/kept")
+ func state(_ id: String, _ meta: String) throws {
+ try directory.file("\(storage)/\(id)/workspace.json", contents: Data(meta.utf8))
+ try directory.file("\(storage)/\(id)/state.vscdb", bytes: 4_096)
+ }
+ try state("a1", #"{"folder": "\#(projects.appending(path: "gone").absoluteString)"}"#)
+ try state("b2", #"{"folder": "\#(projects.appending(path: "kept").absoluteString)"}"#)
+ try state("c3", #"{"workspace": "\#(projects.appending(path: "team.code-workspace").absoluteString)"}"#)
+ try state("d4", #"{"folder": "file:///Volumes/org-example-disk/project"}"#)
+ try state("e5", #"{"folder": "vscode-remote://ssh-remote%2Bhost/home/me/project"}"#)
+ try directory.file("\(storage)/f6/state.vscdb", bytes: 4_096)
+
+ let rows = await scanned(directory.url).flatMap(\.locations).filter { $0.kind == .projectState }
+
+ #expect(rows.map(\.url.lastPathComponent).sorted() == ["a1", "c3"])
+ #expect(Set(rows.compactMap(\.project)) == ["gone", "team"])
+ #expect(rows.allSatisfy { !$0.isRecommended })
+ }
+
@Test func offersVirtualenvwrappersEnvironmentsAndNotItsHooks() async throws {
let directory = try TemporaryDirectory()
try directory.file(".virtualenvs/web/bin/python", bytes: 400_000)
diff --git a/Peel/Views/Developer/DeveloperDetailView.swift b/Peel/Views/Developer/DeveloperDetailView.swift
index 2b8e55a8..6dcb30f4 100644
--- a/Peel/Views/Developer/DeveloperDetailView.swift
+++ b/Peel/Views/Developer/DeveloperDetailView.swift
@@ -52,7 +52,7 @@ struct DeveloperDetailView: View {
NoteBadge(
title: Text("\(keptByDefault) kept"), systemImage: "hand.raised", tint: .secondary,
name: String(localized: "\(keptByDefault) kept"),
- detail: Text("Archives, symbols from your devices, model weights, installed environments, downloads kept to install again, the build data of a project opened in the last week, folders nothing shows the tool made, and anything Peel couldn’t measure are listed but never selected for you.")
+ detail: Text("Archives, symbols from your devices, model weights, installed environments, downloads kept to install again, the build data of a project opened in the last week, an editor’s state for a project that is gone, folders nothing shows the tool made, and anything Peel couldn’t measure are listed but never selected for you.")
)
}
}
@@ -63,6 +63,7 @@ struct DeveloperDetailView: View {
private func detail(for location: DeveloperEnvironment.Location) -> LocalizedStringResource {
if let workspace = location.workspace { return "Build data for \(workspace.name), made again when you build" }
+ if let project = location.project { return "Kept for \(project), a project no longer on this Mac" }
guard let version = location.archive?.label else { return location.kind.title }
return "Version \(version), needed to read its crash reports"
}
@@ -97,6 +98,7 @@ extension DeveloperEnvironment.ContentKind {
case .models: "Model weights or datasets, a long download to get back"
case .environments: "Installed packages, put back by installing them again"
case .keptDownloads: "Downloads kept so you can install them again"
+ case .projectState: "An editor’s state for a project that is gone, its chat history included"
}
}
@@ -111,6 +113,7 @@ extension DeveloperEnvironment.ContentKind {
case .models: "brain"
case .environments: "shippingbox.and.arrow.backward"
case .keptDownloads: "tray.and.arrow.down"
+ case .projectState: "folder.badge.questionmark"
}
}
}