From c50ff5dd29340b96190f88aaf33ef9f82f6cc088 Mon Sep 17 00:00:00 2001 From: David Schachter Date: Tue, 11 Aug 2026 22:57:31 -0700 Subject: [PATCH] ADFA-5109 | Remove unused Room deps from idetooltips ToolTipManager reads documentation.db via raw SQLiteDatabase, not Room (ADR 0001, exception 1) -- no source file in the module imports androidx.room. Drops the now-pointless kapt(room.compiler)/room.ktx deps and the kotlin-kapt plugin they were the only user of, and closes out the ADR 0001 follow-up that flagged this. --- ARCHITECTURE.md | 2 +- docs/adr/0001-prefer-room-for-persistence.md | 3 +-- idetooltips/build.gradle.kts | 4 ---- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 4be5ac177e..f62039f52a 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -102,7 +102,7 @@ These structural facts shape every module. Day-to-day build *commands* live in ` > > **Recent Projects** is the reference example of the default: `app/src/main/java/com/itsaky/androidide/roomData/recentproject/` (`RecentProjectRoomDatabase`, `@Database version = 4` with migrations 1→4; `RecentProjectDao`; the `RecentProject` `@Entity` → table `recent_project_table`). It's provided via Koin in `di/AppModule.kt` and consumed by `MainViewModel`, `RecentProjectsViewModel`, `MainActivity`, `ProjectInfoBottomSheet`, and `ProjectCreationManager`. > -> **Raw SQLite is allowed only when** the database is prebuilt and opened read-only, the data is performance/allocation-critical and needs granular schema control, or the schema is shared across a process/component boundary. Current exceptions: symbol indexing (`lsp/indexing/SQLiteIndex.kt`), tooltips (`idetooltips/ToolTipManager.kt`), in-app/plugin help (`plugin-manager/.../documentation/PluginDocumentationManager.kt`), and the local web server (`app/.../localWebServer/WebServer.kt`). `idetooltips` also declares unused Room Gradle deps (remove them), and the `androidx.room:*` strings in `editor`'s `GroovyAutoComplete` are autocomplete suggestions for the *user's* code, not CoGo persistence. +> **Raw SQLite is allowed only when** the database is prebuilt and opened read-only, the data is performance/allocation-critical and needs granular schema control, or the schema is shared across a process/component boundary. Current exceptions: symbol indexing (`lsp/indexing/SQLiteIndex.kt`), tooltips (`idetooltips/ToolTipManager.kt`), in-app/plugin help (`plugin-manager/.../documentation/PluginDocumentationManager.kt`), and the local web server (`app/.../localWebServer/WebServer.kt`). The `androidx.room:*` strings in `editor`'s `GroovyAutoComplete` are autocomplete suggestions for the *user's* code, not CoGo persistence. ## State Management diff --git a/docs/adr/0001-prefer-room-for-persistence.md b/docs/adr/0001-prefer-room-for-persistence.md index 6a12919bef..e8c484914d 100644 --- a/docs/adr/0001-prefer-room-for-persistence.md +++ b/docs/adr/0001-prefer-room-for-persistence.md @@ -37,7 +37,7 @@ If none of these hold, use Room. "It's a small table" or "I already know SQL" ar The **Recent Projects** feature (`app/.../roomData/recentproject/`, `RecentProjectRoomDatabase`, `@Database version = 4`) is **not** an exception — it uses Room and is the reference example of the default. Extend it (and add new persistence) the same way. -> Note: `idetooltips` still declares Room Gradle deps it doesn't use — remove them (its store is raw SQLite by exception 1). And the `androidx.room:*` strings in `editor`'s `GroovyAutoComplete` are autocomplete suggestions for the *user's* code, not CoGo persistence. +> Note: the `androidx.room:*` strings in `editor`'s `GroovyAutoComplete` are autocomplete suggestions for the *user's* code, not CoGo persistence. ## Consequences @@ -51,7 +51,6 @@ The **Recent Projects** feature (`app/.../roomData/recentproject/`, `RecentProje - Contributors must justify raw-SQLite use rather than reach for it by habit. **Follow-ups** -- Remove the unused Room dependencies from `idetooltips`. - Provide shared helper utilities for the raw-SQLite exceptions so they stay consistent and safe (parameterized queries — see SECURITY.md). ## Alternatives considered diff --git a/idetooltips/build.gradle.kts b/idetooltips/build.gradle.kts index 4716486943..42999a14f9 100644 --- a/idetooltips/build.gradle.kts +++ b/idetooltips/build.gradle.kts @@ -3,7 +3,6 @@ import com.itsaky.androidide.build.config.BuildConfig plugins { alias(libs.plugins.kotlin.android) alias(libs.plugins.android.library) - id("kotlin-kapt") } android { @@ -20,9 +19,6 @@ kotlin { } dependencies { - kapt(libs.room.compiler) - - implementation(libs.room.ktx) implementation(libs.google.gson) implementation(libs.google.guava) implementation(libs.androidx.constraintlayout)